Created
August 9, 2021 00:01
-
-
Save amadeus/eb1b6af8e58ccfb8476800ae453af274 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |
if (timer_elapsed(tt_timer) > 500) { | |
press_count = 0; | |
} | |
switch (keycode) { | |
case TT_LL: { | |
if (record->event.pressed) { | |
if (layer_state_is(_LOWER)) { | |
layer_off(_LOWER); | |
press_count = 0; | |
tt_timer = 0; | |
} else { | |
press_count += 1; | |
layer_on(_LOWER); | |
tt_timer = timer_read(); | |
} | |
} else { | |
if (press_count < 3) { | |
layer_off(_LOWER); | |
} | |
} | |
break; | |
} | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment