Skip to content

Instantly share code, notes, and snippets.

@amadeus
Created August 9, 2021 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amadeus/eb1b6af8e58ccfb8476800ae453af274 to your computer and use it in GitHub Desktop.
Save amadeus/eb1b6af8e58ccfb8476800ae453af274 to your computer and use it in GitHub Desktop.
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