From 06d354c06b473864ddc97ca347a6d4ffd00bbda3 Mon Sep 17 00:00:00 2001 From: tmk Date: Mon, 8 Feb 2021 16:22:55 +0900 Subject: [PATCH] core: Fix is_tap_key() #673 System and media control keys work well with ACTION_MODS_TAP_KEY and ACTION_LAYER_TAP_KEY now. --- tmk_core/common/action.c | 9 +++++---- tmk_core/common/action_code.h | 6 ++---- tmk_core/common/keycode.h | 3 ++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 73c70f0e..a53b3a3f 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -555,18 +555,19 @@ bool is_tap_key(keyevent_t event) switch (action.key.code) { case MODS_ONESHOT: case MODS_TAP_TOGGLE: - case KC_A ... KC_EXSEL: // tap key - case KC_LCTRL ... KC_RGUI: // tap key + default: // tap key return true; } case ACT_LAYER_TAP: case ACT_LAYER_TAP_EXT: switch (action.layer_tap.code) { + case OP_ON_OFF: + case OP_OFF_ON: + case OP_SET_CLEAR: case 0xc0 ... 0xdf: // with modifiers return false; - case KC_A ... KC_EXSEL: // tap key - case KC_LCTRL ... KC_RGUI: // tap key case OP_TAP_TOGGLE: + default: // tap key return true; } return false; diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index 77c7c342..b40a4596 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h @@ -36,8 +36,7 @@ along with this program. If not, see . * 001r|mods|0000 0000 Modifiers with OneShot[TAP] * 001r|mods|0000 0001 Modifiers with tap toggle[TAP] * 001r|mods|0000 00xx (reserved) (0x02-03) - * 001r|mods| keycode Modifiers with tap key(0x04-A4, E0-E7)[TAP] - * (reserved) (0xA5-DF, E8-FF) + * 001r|mods| keycode Modifiers with tap key[TAP] * * * Other Keys(01xx) @@ -71,10 +70,9 @@ along with this program. If not, see . * 1001|oopp|BBBB BBBB 8-bit Bitwise Operation??? * * ACT_LAYER_TAP(101x): - * 101E|LLLL| keycode On/Off with tap key (0x04-A4, E0-E7)[TAP] + * 101E|LLLL| keycode On/Off with tap key [TAP] * 101E|LLLL|110r mods On/Off with modifiers (0xC0-DF)[NOT TAP] * r: Left/Right flag(Left:0, Right:1) - * (reserved) (0xA5-BF, E8-EF) * 101E|LLLL|1111 0000 Invert with tap toggle (0xF0) [TAP] * 101E|LLLL|1111 0001 On/Off (0xF1) [NOT TAP] * 101E|LLLL|1111 0010 Off/On (0xF2) [NOT TAP] diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index 162f4362..7ed711a4 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -26,7 +26,8 @@ along with this program. If not, see . #define IS_ERROR(code) (KC_ROLL_OVER <= (code) && (code) <= KC_UNDEFINED) #define IS_ANY(code) (KC_A <= (code) && (code) <= 0xFF) -#ifndef ACTIONMAP_ENABLE +// Use original HID usages on B0-DD instead of TMK specific codes +#ifndef USE_ORIGINAL_HID_USAGE #define IS_KEY(code) (KC_A <= (code) && (code) <= KC_EXSEL) #else #define IS_KEY(code) ((KC_A <= (code) && (code) <= KC_EXSEL) || \ -- 2.46.2