diff options
| author | zk-phi <zk-phi@users.noreply.github.com> | 2020-01-10 16:48:06 +0900 |
|---|---|---|
| committer | ridingqwerty <george.g.koenig@gmail.com> | 2020-01-10 02:48:06 -0500 |
| commit | 7f388b65530b06779089be6cb4ddc56b2ecb36ff (patch) | |
| tree | 19cf455d8ca3ae379304ea212d5b3d85917137b9 /tmk_core | |
| parent | e34af631c2c4b0c9406dead907bf74b460ee9f7f (diff) | |
| download | qmk_firmware-7f388b65530b06779089be6cb4ddc56b2ecb36ff.tar.gz qmk_firmware-7f388b65530b06779089be6cb4ddc56b2ecb36ff.zip | |
Add per-key IGNORE_MOD_TAP_INTERRUPT feature (#7838)
* Implement IGNORE_MOD_TAP_INTERRUPT_PER_KEY
- Add configurable option IGNORE_MOD_TAP_INTERRUPT_PER_KEY
- Add function get_ignore_mod_tap_interrupt iff the option is enabled
Unless IGNORE_MOD_TAP_INTERRUPT_PER_KEY is defined, this patch does not affect the resulting binary.
* Add documentation for IGNORE_MOD_TAP_INTERRUPT_PER_KEY
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/action.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 7fbdbd8c3..d6062703e 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c | |||
| @@ -47,6 +47,10 @@ int retro_tapping_counter = 0; | |||
| 47 | # include <fauxclicky.h> | 47 | # include <fauxclicky.h> |
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
| 50 | #ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY | ||
| 51 | __attribute__ ((weak)) bool get_ignore_mod_tap_interrupt(uint16_t keycode) { return false; } | ||
| 52 | #endif | ||
| 53 | |||
| 50 | #ifndef TAP_CODE_DELAY | 54 | #ifndef TAP_CODE_DELAY |
| 51 | # define TAP_CODE_DELAY 0 | 55 | # define TAP_CODE_DELAY 0 |
| 52 | #endif | 56 | #endif |
| @@ -308,8 +312,12 @@ void process_action(keyrecord_t *record, action_t action) { | |||
| 308 | default: | 312 | default: |
| 309 | if (event.pressed) { | 313 | if (event.pressed) { |
| 310 | if (tap_count > 0) { | 314 | if (tap_count > 0) { |
| 311 | # ifndef IGNORE_MOD_TAP_INTERRUPT | 315 | # if !defined(IGNORE_MOD_TAP_INTERRUPT) || defined(IGNORE_MOD_TAP_INTERRUPT_PER_KEY) |
| 312 | if (record->tap.interrupted) { | 316 | if ( |
| 317 | # ifdef IGNORE_MOD_TAP_INTERRUPT_PER_KEY | ||
| 318 | !get_ignore_mod_tap_interrupt(get_event_keycode(record->event)) && | ||
| 319 | # endif | ||
| 320 | record->tap.interrupted) { | ||
| 313 | dprint("mods_tap: tap: cancel: add_mods\n"); | 321 | dprint("mods_tap: tap: cancel: add_mods\n"); |
| 314 | // ad hoc: set 0 to cancel tap | 322 | // ad hoc: set 0 to cancel tap |
| 315 | record->tap.count = 0; | 323 | record->tap.count = 0; |
