diff options
| author | Nick Brassel <nick@tzarc.org> | 2022-08-29 14:53:08 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-28 21:53:08 -0700 |
| commit | d910e8df77150bab0b9cc2c3794554b4c8c81d71 (patch) | |
| tree | f1aba103818da93378f0f30b8dde5526fb29d443 /quantum/encoder.c | |
| parent | 7ef6c179e44632840dac7c8c6896becdf60b9e48 (diff) | |
Use `TAP_CODE_DELAY` for encoder mapping by default (#18098)
Diffstat (limited to 'quantum/encoder.c')
| -rw-r--r-- | quantum/encoder.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/quantum/encoder.c b/quantum/encoder.c index 5f8a7ce080..1393e34868 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c | |||
| @@ -24,7 +24,8 @@ | |||
| 24 | #include <string.h> | 24 | #include <string.h> |
| 25 | 25 | ||
| 26 | #ifndef ENCODER_MAP_KEY_DELAY | 26 | #ifndef ENCODER_MAP_KEY_DELAY |
| 27 | # define ENCODER_MAP_KEY_DELAY 2 | 27 | # include "action.h" |
| 28 | # define ENCODER_MAP_KEY_DELAY TAP_CODE_DELAY | ||
| 28 | #endif | 29 | #endif |
| 29 | 30 | ||
| 30 | #if !defined(ENCODER_RESOLUTIONS) && !defined(ENCODER_RESOLUTION) | 31 | #if !defined(ENCODER_RESOLUTIONS) && !defined(ENCODER_RESOLUTION) |
| @@ -143,9 +144,14 @@ void encoder_init(void) { | |||
| 143 | static void encoder_exec_mapping(uint8_t index, bool clockwise) { | 144 | static void encoder_exec_mapping(uint8_t index, bool clockwise) { |
| 144 | // The delays below cater for Windows and its wonderful requirements. | 145 | // The delays below cater for Windows and its wonderful requirements. |
| 145 | action_exec(clockwise ? ENCODER_CW_EVENT(index, true) : ENCODER_CCW_EVENT(index, true)); | 146 | action_exec(clockwise ? ENCODER_CW_EVENT(index, true) : ENCODER_CCW_EVENT(index, true)); |
| 147 | # if ENCODER_MAP_KEY_DELAY > 0 | ||
| 146 | wait_ms(ENCODER_MAP_KEY_DELAY); | 148 | wait_ms(ENCODER_MAP_KEY_DELAY); |
| 149 | # endif // ENCODER_MAP_KEY_DELAY > 0 | ||
| 150 | |||
| 147 | action_exec(clockwise ? ENCODER_CW_EVENT(index, false) : ENCODER_CCW_EVENT(index, false)); | 151 | action_exec(clockwise ? ENCODER_CW_EVENT(index, false) : ENCODER_CCW_EVENT(index, false)); |
| 152 | # if ENCODER_MAP_KEY_DELAY > 0 | ||
| 148 | wait_ms(ENCODER_MAP_KEY_DELAY); | 153 | wait_ms(ENCODER_MAP_KEY_DELAY); |
| 154 | # endif // ENCODER_MAP_KEY_DELAY > 0 | ||
| 149 | } | 155 | } |
| 150 | #endif // ENCODER_MAP_ENABLE | 156 | #endif // ENCODER_MAP_ENABLE |
| 151 | 157 | ||
