diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2016-02-07 11:14:47 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-02-07 11:14:47 -0500 |
| commit | cf2c6415570753c48fdd2c406d0780e14e7a7167 (patch) | |
| tree | ca2e3729db6c737e01bb2a719c4c912336d19701 | |
| parent | 3a6e88d6f8982fae578b5a0094657c798aafbd38 (diff) | |
| download | qmk_firmware-cf2c6415570753c48fdd2c406d0780e14e7a7167.tar.gz qmk_firmware-cf2c6415570753c48fdd2c406d0780e14e7a7167.zip | |
advanced macro stuff for README
| -rw-r--r-- | README.md | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -150,35 +150,35 @@ if (record->event.pressed) { | |||
| 150 | } | 150 | } |
| 151 | ``` | 151 | ``` |
| 152 | 152 | ||
| 153 | #### `record->tap.count` | 153 | * `record->tap.count` |
| 154 | 154 | ||
| 155 | The number taps that a certain key gets without interruption. This value can also be reset by assigning it `0`. | 155 | The number taps that a certain key gets without interruption. This value can also be reset by assigning it `0`. |
| 156 | 156 | ||
| 157 | #### `register_code(<kc>);` | 157 | * `register_code(<kc>);` |
| 158 | 158 | ||
| 159 | This sends the `<kc>` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`. | 159 | This sends the `<kc>` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`. |
| 160 | 160 | ||
| 161 | #### `unregister_code(<kc>);` | 161 | * `unregister_code(<kc>);` |
| 162 | 162 | ||
| 163 | Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent. | 163 | Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent. |
| 164 | 164 | ||
| 165 | #### `layer_on(<n>);` | 165 | * `layer_on(<n>);` |
| 166 | 166 | ||
| 167 | This will turn on the layer `<n>` - the higher layer number will always take priority. Make sure you have `KC_TRNS` for the key you're pressing on the layer you're switching to, or you'll get stick there unless you have another plan. | 167 | This will turn on the layer `<n>` - the higher layer number will always take priority. Make sure you have `KC_TRNS` for the key you're pressing on the layer you're switching to, or you'll get stick there unless you have another plan. |
| 168 | 168 | ||
| 169 | #### `layer_off(<n>);` | 169 | * `layer_off(<n>);` |
| 170 | 170 | ||
| 171 | This will turn off the layer `<n>`. | 171 | This will turn off the layer `<n>`. |
| 172 | 172 | ||
| 173 | #### `clear_keyboard();` | 173 | * `clear_keyboard();` |
| 174 | 174 | ||
| 175 | This will clear all mods and keys currently pressed. | 175 | This will clear all mods and keys currently pressed. |
| 176 | 176 | ||
| 177 | #### `clear_mods();` | 177 | * `clear_mods();` |
| 178 | 178 | ||
| 179 | This will clear all mods currently pressed. | 179 | This will clear all mods currently pressed. |
| 180 | 180 | ||
| 181 | #### `clear_keyboard_but_mods();` | 181 | * `clear_keyboard_but_mods();` |
| 182 | 182 | ||
| 183 | This will clear all keys besides the mods currently pressed. | 183 | This will clear all keys besides the mods currently pressed. |
| 184 | 184 | ||
| @@ -196,7 +196,7 @@ if (timer_elapsed(key_timer) < 100) { | |||
| 196 | } | 196 | } |
| 197 | ``` | 197 | ``` |
| 198 | 198 | ||
| 199 | It's best to declare the `static uint16_t start;` outside of the macro block (top of file, etc). | 199 | It's best to declare the `static uint16_t key_timer;` outside of the macro block (top of file, etc). |
| 200 | 200 | ||
| 201 | ## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) | 201 | ## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) |
| 202 | 202 | ||
