diff options
Diffstat (limited to 'tmk_core/common')
-rw-r--r-- | tmk_core/common/action.c | 28 | ||||
-rw-r--r-- | tmk_core/common/action_tapping.c | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index a534f818ec..cffc0b9ebe 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -34,6 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "nodebug.h" #endif +int tp_buttons; + #ifdef FAUXCLICKY_ENABLE #include <fauxclicky.h> #endif @@ -311,9 +313,35 @@ void process_action(keyrecord_t *record, action_t action) /* Mouse key */ case ACT_MOUSEKEY: if (event.pressed) { + switch (action.key.code) { + case KC_MS_BTN1: + tp_buttons |= (1<<0); + break; + case KC_MS_BTN2: + tp_buttons |= (1<<1); + break; + case KC_MS_BTN3: + tp_buttons |= (1<<2); + break; + default: + break; + } mousekey_on(action.key.code); mousekey_send(); } else { + switch (action.key.code) { + case KC_MS_BTN1: + tp_buttons &= ~(1<<0); + break; + case KC_MS_BTN2: + tp_buttons &= ~(1<<1); + break; + case KC_MS_BTN3: + tp_buttons &= ~(1<<2); + break; + default: + break; + } mousekey_off(action.key.code); mousekey_send(); } diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c index bd9a69ae0a..531a3ca345 100644 --- a/tmk_core/common/action_tapping.c +++ b/tmk_core/common/action_tapping.c @@ -96,7 +96,7 @@ bool process_tapping(keyrecord_t *keyp) // enqueue return false; } -#if TAPPING_TERM >= 500 +#if TAPPING_TERM >= 500 || defined PERMISSIVE_HOLD /* Process a key typed within TAPPING_TERM * This can register the key before settlement of tapping, * useful for long TAPPING_TERM but may prevent fast typing. |