From fa1ee47cf2293d06693b86e8dd188d9fbc9338c4 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Tue, 4 Sep 2018 00:18:37 +0100 Subject: Enable mouse keys in register_code and unregister_code This allows for macros to be assigned to press two mouse directions at same time, which allows for one key diagonals. --- tmk_core/common/action.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tmk_core/common/action.c') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index f7c039f45..76c150b40 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -773,6 +773,9 @@ void register_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); } + else if IS_MOUSEKEY(code) { + mousekey_on(code); + } } /** \brief Utilities for actions. (FIXME: Needs better description) @@ -832,6 +835,9 @@ void unregister_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(0); } + else if IS_MOUSEKEY(code) { + mousekey_off(code); + } } /** \brief Utilities for actions. (FIXME: Needs better description) -- cgit v1.2.3-24-g4f1b From a14eb01883cd135105cebd4d5570337250cc76cb Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 3 Sep 2018 19:48:09 -0400 Subject: fix mousekey call --- tmk_core/common/action.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'tmk_core/common/action.c') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 76c150b40..ae0864749 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -773,9 +773,12 @@ void register_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); } - else if IS_MOUSEKEY(code) { - mousekey_on(code); - } + + #ifdef MOUSEKEY_ENABLE + else if IS_MOUSEKEY(code) { + mousekey_on(code); + } + #endif } /** \brief Utilities for actions. (FIXME: Needs better description) @@ -835,9 +838,11 @@ void unregister_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(0); } - else if IS_MOUSEKEY(code) { - mousekey_off(code); - } + #ifdef MOUSEKEY_ENABLE + else if IS_MOUSEKEY(code) { + mousekey_off(code); + } + #endif } /** \brief Utilities for actions. (FIXME: Needs better description) -- cgit v1.2.3-24-g4f1b From 743449472e58651ec8111e6f70811103fb0a28bd Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Mon, 17 Sep 2018 10:48:02 -0700 Subject: Make `PREVENT_STUCK_MODIFIERS` the default (#3107) * Remove chording as it is not documented, not used, and needs work. * Make Leader Key an optional feature. * Switch from `PREVENT_STUCK_MODIFIERS` to `STRICT_LAYER_RELEASE` * Remove `#define PREVENT_STUCK_MODIFIERS` from keymaps. --- tmk_core/common/action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmk_core/common/action.c') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index ae0864749..76d02bc9d 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -120,7 +120,7 @@ void process_hand_swap(keyevent_t *event) { } #endif -#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) bool disable_action_cache = false; void process_record_nocache(keyrecord_t *record) -- cgit v1.2.3-24-g4f1b From dad579c8f81bdde08e598f9d99249893d5d779a8 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 3 Oct 2018 22:33:06 -0700 Subject: Add mousekey_send to (un)register_code --- tmk_core/common/action.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tmk_core/common/action.c') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 76d02bc9d..8bdcd54e3 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -777,6 +777,7 @@ void register_code(uint8_t code) #ifdef MOUSEKEY_ENABLE else if IS_MOUSEKEY(code) { mousekey_on(code); + mousekey_send(); } #endif } @@ -841,6 +842,7 @@ void unregister_code(uint8_t code) #ifdef MOUSEKEY_ENABLE else if IS_MOUSEKEY(code) { mousekey_off(code); + mousekey_send(); } #endif } -- cgit v1.2.3-24-g4f1b From 02d44beb4410b806cb8c38e272941d212fee8a74 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 09:01:58 -0800 Subject: Fix up tap_code functionality (#4609) * Add delay in Tap Code to avoid issues I think a few people have reporting issues with it working properly, and it may be a timing issue. The 'register_code' uses this sort of delay in some of the functions, and this is probably why. Adding the 100ms delay should hopefully fix any issues with it. * Make tap_code delay configurable * Update documentation * Bring tap_code16 inline with changes * Fix type for tap_code16 Bad copy-paste job * Just use the value check for the define * Clarify timing in docs Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna --- tmk_core/common/action.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tmk_core/common/action.c') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 8bdcd54e3..456d1e25f 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -847,6 +847,18 @@ void unregister_code(uint8_t code) #endif } +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +void tap_code(uint8_t code) { + register_code(code); + #if TAP_CODE_DELAY > 0 + wait_ms(TAP_CODE_DELAY); + #endif + unregister_code(code); +} + /** \brief Utilities for actions. (FIXME: Needs better description) * * FIXME: Needs documentation. -- cgit v1.2.3-24-g4f1b From 93b004c943a4b13bd640fc83000e910b72cb4640 Mon Sep 17 00:00:00 2001 From: Konstantin Đorđević Date: Fri, 28 Dec 2018 20:07:56 +0100 Subject: Keep pressed keys on layer state change (fixes #2053, #2279) (#3905) * Keep pressed keys on layer state change * Add doc comment for clear_keyboard_but_mods_and_keys * Keep pressed keys only if PREVENT_STUCK_MODIFIERS is on * Check STRICT_LAYER_RELEASE instead of PREVENT_STUCK_MODIFIERS --- tmk_core/common/action.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tmk_core/common/action.c') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 456d1e25f..b99c2acaa 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -898,10 +898,19 @@ void clear_keyboard(void) * FIXME: Needs documentation. */ void clear_keyboard_but_mods(void) +{ + clear_keys(); + clear_keyboard_but_mods_and_keys(); +} + +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +void clear_keyboard_but_mods_and_keys() { clear_weak_mods(); clear_macro_mods(); - clear_keys(); send_keyboard_report(); #ifdef MOUSEKEY_ENABLE mousekey_clear(); -- cgit v1.2.3-24-g4f1b