Fix is_tap_key()

example_keyboards
tmk 12 years ago
parent 0be309ccc6
commit eea85c7e24

@ -816,18 +816,18 @@ bool is_tap_key(key_t key)
case ACT_LAYER: case ACT_LAYER:
case ACT_LAYER_BIT: case ACT_LAYER_BIT:
switch (action.layer.code) { switch (action.layer.code) {
case 0x00: case LAYER_MOMENTARY:
case 0xF1 ... 0xFF: case LAYER_ON_PRESS:
case LAYER_ON_RELEASE:
case LAYER_DEFAULT:
return false; return false;
case 0xF0: case LAYER_TAP_TOGGLE:
default: default: /* tap key */
return true; return true;
} }
return false; return false;
case ACT_FUNCTION: case ACT_FUNCTION:
if (action.func.opt & FUNC_TAP) { if (action.func.opt & FUNC_TAP) { return true; }
return true;
}
return false; return false;
} }
return false; return false;

@ -323,7 +323,7 @@ enum usage_pages {
/* Function */ /* Function */
enum function_opts { 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(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | id)
#define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | id) #define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | id)

Loading…
Cancel
Save