]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
core: Fix is_tap_key() #673
authortmk <hasu@tmk-kbd.com>
Mon, 8 Feb 2021 07:22:55 +0000 (16:22 +0900)
committertmk <hasu@tmk-kbd.com>
Mon, 8 Feb 2021 07:28:59 +0000 (16:28 +0900)
System and media control keys work well with
ACTION_MODS_TAP_KEY and ACTION_LAYER_TAP_KEY now.

tmk_core/common/action.c
tmk_core/common/action_code.h
tmk_core/common/keycode.h

index 73c70f0e1fb932a77fcef22e4ecfdd708bce0761..a53b3a3f5faf5b929d2ec3119a523e23867e7e02 100644 (file)
@@ -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;
index 77c7c3429cdf693cb1eb638c477f842dd988e5e7..b40a4596710f7d77cd935fe056ff6ce119614b69 100644 (file)
@@ -36,8 +36,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * 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 <http://www.gnu.org/licenses/>.
  * 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]
index 162f43621b844e64823c417deeb08b4bbdcc9cf5..7ed711a4c63c011caad4d429098ac78abed13bac 100644 (file)
@@ -26,7 +26,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #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) || \