diff options
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/action_tapping.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c index 1701ae471..36839f9fa 100644 --- a/tmk_core/common/action_tapping.c +++ b/tmk_core/common/action_tapping.c | |||
| @@ -40,6 +40,10 @@ __attribute__((weak)) bool get_tapping_force_hold(uint16_t keycode, keyrecord_t | |||
| 40 | __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { return false; } | 40 | __attribute__((weak)) bool get_permissive_hold(uint16_t keycode, keyrecord_t *record) { return false; } |
| 41 | # endif | 41 | # endif |
| 42 | 42 | ||
| 43 | # ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY | ||
| 44 | __attribute__((weak)) bool get_hold_on_other_key_press(uint16_t keycode, keyrecord_t *record) { return false; } | ||
| 45 | # endif | ||
| 46 | |||
| 43 | static keyrecord_t tapping_key = {}; | 47 | static keyrecord_t tapping_key = {}; |
| 44 | static keyrecord_t waiting_buffer[WAITING_BUFFER_SIZE] = {}; | 48 | static keyrecord_t waiting_buffer[WAITING_BUFFER_SIZE] = {}; |
| 45 | static uint8_t waiting_buffer_head = 0; | 49 | static uint8_t waiting_buffer_head = 0; |
| @@ -175,6 +179,19 @@ bool process_tapping(keyrecord_t *keyp) { | |||
| 175 | // set interrupted flag when other key preesed during tapping | 179 | // set interrupted flag when other key preesed during tapping |
| 176 | if (event.pressed) { | 180 | if (event.pressed) { |
| 177 | tapping_key.tap.interrupted = true; | 181 | tapping_key.tap.interrupted = true; |
| 182 | # if defined(HOLD_ON_OTHER_KEY_PRESS) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) | ||
| 183 | # if defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY) | ||
| 184 | if (get_hold_on_other_key_press(get_record_keycode(&tapping_key, false), keyp)) | ||
| 185 | # endif | ||
| 186 | { | ||
| 187 | debug("Tapping: End. No tap. Interfered by pressed key\n"); | ||
| 188 | process_record(&tapping_key); | ||
| 189 | tapping_key = (keyrecord_t){}; | ||
| 190 | debug_tapping_key(); | ||
| 191 | // enqueue | ||
| 192 | return false; | ||
| 193 | } | ||
| 194 | # endif | ||
| 178 | } | 195 | } |
| 179 | // enqueue | 196 | // enqueue |
| 180 | return false; | 197 | return false; |
