1
0

enable TAPPING_TOGGLE=1 to work correctly

if TAPPING_TOGGLE is 1, then tap a single time should toggle the mods on/off each tap.

Previously this was broken, this fixes it. This allows the same key to either hold (momentary mod) or tap (toggle mod, like capslock).
This commit is contained in:
Jeff Gran 2015-11-26 00:42:42 -07:00 committed by tmk
parent 2d673dfabc
commit d60a9b9048

View File

@ -131,10 +131,17 @@ void process_action(keyrecord_t *record)
case MODS_TAP_TOGGLE: case MODS_TAP_TOGGLE:
if (event.pressed) { if (event.pressed) {
if (tap_count <= TAPPING_TOGGLE) { if (tap_count <= TAPPING_TOGGLE) {
if (mods & get_mods()) {
dprint("MODS_TAP_TOGGLE: toggle mods off\n");
unregister_mods(mods);
} else {
dprint("MODS_TAP_TOGGLE: toggle mods on\n");
register_mods(mods); register_mods(mods);
} }
}
} else { } else {
if (tap_count < TAPPING_TOGGLE) { if (tap_count < TAPPING_TOGGLE) {
dprint("MODS_TAP_TOGGLE: release : unregister_mods\n");
unregister_mods(mods); unregister_mods(mods);
} }
} }