]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Fix is_tap_key()
authortmk <nobody@nowhere>
Sun, 10 Feb 2013 15:02:11 +0000 (00:02 +0900)
committertmk <nobody@nowhere>
Sun, 10 Feb 2013 15:02:11 +0000 (00:02 +0900)
common/action.c
common/action.h

index f6e50032eb0d705c5f57b4d380127f0c75e593bb..6d5336752ed29acd2b7cc8c8b7e8a30b105bec9b 100644 (file)
@@ -816,18 +816,18 @@ bool is_tap_key(key_t key)
         case ACT_LAYER:
         case ACT_LAYER_BIT:
             switch (action.layer.code) {
-                case 0x00:
-                case 0xF1 ... 0xFF:
+                case LAYER_MOMENTARY:
+                case LAYER_ON_PRESS:
+                case LAYER_ON_RELEASE:
+                case LAYER_DEFAULT:
                     return false;
-                case 0xF0:
-                default:
+                case LAYER_TAP_TOGGLE:
+                default:    /* tap key */
                     return true;
             }
             return false;
         case ACT_FUNCTION:
-            if (action.func.opt & FUNC_TAP) {
-                return true;
-            }
+            if (action.func.opt & FUNC_TAP) { return true; }
             return false;
     }
     return false;
index 800554eb8fd88efddede5e1363c0b4885ba0eaa8..9b559cb181d5e66716d67b2dc429b79eb3470980 100644 (file)
@@ -323,7 +323,7 @@ enum usage_pages {
 
 /* Function */
 enum function_opts {
-    FUNC_TAP        = 0x8,
+    FUNC_TAP        = 0x8,      /* indciates function is tappable */
 };
 #define ACTION_FUNCTION(id, opt)        ACTION(ACT_FUNCTION, (opt)<<8 | id)
 #define ACTION_FUNCTION_TAP(id)         ACTION(ACT_FUNCTION, FUNC_TAP<<8 | id)