Skip to content

Instantly share code, notes, and snippets.

@sartak
Last active December 26, 2022 18:44
Show Gist options
  • Save sartak/6e26064ed314978e3c6561a5ee527a8d to your computer and use it in GitHub Desktop.
Save sartak/6e26064ed314978e3c6561a5ee527a8d to your computer and use it in GitHub Desktop.
Repeat Key
#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