Last active
December 26, 2022 18:44
-
-
Save sartak/6e26064ed314978e3c6561a5ee527a8d to your computer and use it in GitHub Desktop.
Repeat Key
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
#include QMK_KEYBOARD_H | |
enum custom_keycodes { | |
REP = SAFE_RANGE | |
}; | |
// use REP in the layout | |
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = ... | |
uint16_t key = 0; | |
bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |
if(record->event.pressed) { | |
#ifdef FORCE_REP_KEY | |
if(keycode == key) { | |
return false; | |
} | |
#endif | |
if(keycode == REP) { | |
tap_code(key); | |
return false; | |
} else { | |
key = keycode; | |
return true; | |
} | |
} | |
return true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment