1
0

Fix tap key bug: layer stuck

- Can't use Invert action for tap key, use On/Off insted.
This commit is contained in:
tmk 2013-02-20 16:53:55 +09:00
parent c3d57b69e0
commit 59e073e82b

View File

@ -499,20 +499,20 @@ static void process_action(keyrecord_t *record)
/* Keymap Bit invert with tap key */ /* Keymap Bit invert with tap key */
default: default:
if (event.pressed) { if (event.pressed) {
if (IS_TAPPING_KEY(event.key) && tap_count > 0) { if (tap_count > 0) {
debug("KEYMAP_TAP_KEY: Tap: register_code\n"); debug("KEYMAP_TAP_KEY: Tap: register_code\n");
register_code(action.layer.code); register_code(action.layer.code);
} else { } else {
debug("KEYMAP_TAP_KEY: No tap: invert on press\n"); debug("KEYMAP_TAP_KEY: No tap: On on press\n");
keymap_invert(action.layer.val); keymap_on(action.layer.val);
} }
} else { } else {
if (IS_TAPPING_KEY(event.key) && tap_count > 0) { if (tap_count > 0) {
debug("KEYMAP_TAP_KEY: Tap: unregister_code\n"); debug("KEYMAP_TAP_KEY: Tap: unregister_code\n");
unregister_code(action.layer.code); unregister_code(action.layer.code);
} else { } else {
debug("KEYMAP_TAP_KEY: No tap: invert on release\n"); debug("KEYMAP_TAP_KEY: No tap: Off on release\n");
keymap_invert(action.layer.val); keymap_off(action.layer.val);
} }
} }
break; break;
@ -649,20 +649,20 @@ static void process_action(keyrecord_t *record)
/* Overlay Bit invert with tap key */ /* Overlay Bit invert with tap key */
default: default:
if (event.pressed) { if (event.pressed) {
if (IS_TAPPING_KEY(event.key) && tap_count > 0) { if (tap_count > 0) {
debug("OVERLAY_TAP_KEY: Tap: register_code\n"); debug("OVERLAY_TAP_KEY: Tap: register_code\n");
register_code(action.layer.code); register_code(action.layer.code);
} else { } else {
debug("OVERLAY_TAP_KEY: No tap: invert on press\n"); debug("OVERLAY_TAP_KEY: No tap: On on press\n");
overlay_invert(action.layer.val); overlay_on(action.layer.val);
} }
} else { } else {
if (IS_TAPPING_KEY(event.key) && tap_count > 0) { if (tap_count > 0) {
debug("OVERLAY_TAP_KEY: Tap: unregister_code\n"); debug("OVERLAY_TAP_KEY: Tap: unregister_code\n");
unregister_code(action.layer.code); unregister_code(action.layer.code);
} else { } else {
debug("OVERLAY_TAP_KEY: No tap: invert on release\n"); debug("OVERLAY_TAP_KEY: No tap: Off on release\n");
overlay_invert(action.layer.val); overlay_off(action.layer.val);
} }
} }
break; break;