aboutsummaryrefslogtreecommitdiff
path: root/docs/FAQ-Keymap.md
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-06-10 12:27:05 -0400
committerGitHub <noreply@github.com>2017-06-10 12:27:05 -0400
commit2508b9b6e23d9569569ff0c99b83f1a81bc66f45 (patch)
tree00c0ba26b4e068e810ba4ad52b7569d01607c81b /docs/FAQ-Keymap.md
parent1da0a19177effe3a946a5188c692fa8749a3a4f1 (diff)
parent43b6179febfd25d6d9ce672c7303edff26f3c300 (diff)
downloadqmk_firmware-2508b9b6e23d9569569ff0c99b83f1a81bc66f45.tar.gz
qmk_firmware-2508b9b6e23d9569569ff0c99b83f1a81bc66f45.zip
Merge pull request #1380 from qmk/improve_macro_docs
Clean up and improve the macro documentation
Diffstat (limited to 'docs/FAQ-Keymap.md')
-rw-r--r--docs/FAQ-Keymap.md21
1 files changed, 19 insertions, 2 deletions
diff --git a/docs/FAQ-Keymap.md b/docs/FAQ-Keymap.md
index 7c73f571f..623726ab2 100644
--- a/docs/FAQ-Keymap.md
+++ b/docs/FAQ-Keymap.md
@@ -111,7 +111,6 @@ https://github.com/tekezo/Karabiner/issues/403
111 111
112## Esc and `~ on a key 112## Esc and `~ on a key
113 113
114
115You can define FC660 and Poker style ESC with `ACTION_LAYER_MODS`. 114You can define FC660 and Poker style ESC with `ACTION_LAYER_MODS`.
116https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers 115https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#35-momentary-switching-with-modifiers
117 116
@@ -245,4 +244,22 @@ without weak mods,
245here real_mods lost state for 'physical left shift'. 244here real_mods lost state for 'physical left shift'.
246 245
247weak_mods is ORed with real_mods when keyboard report is sent. 246weak_mods is ORed with real_mods when keyboard report is sent.
248https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57 \ No newline at end of file 247https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57
248
249## Timer functionality
250
251It's possible to start timers and read values for time-specific events - here's an example:
252
253```c
254static uint16_t key_timer;
255key_timer = timer_read();
256
257if (timer_elapsed(key_timer) < 100) {
258 // do something if less than 100ms have passed
259} else {
260 // do something if 100ms or more have passed
261}
262```
263
264It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in.
265