Fix FORCE_NKRO handling (#7601)

refactor_process_record_kb_user
Joel Challis 6 years ago committed by Drashna Jaelre
parent 071eb2478f
commit efb21c00ce
  1. 16
      quantum/process_keycode/process_magic.c
  2. 1
      tmk_core/common/keyboard.c

@ -39,10 +39,10 @@ float cg_swap_song[][2] = CG_SWAP_SONG;
*/
bool process_magic(uint16_t keycode, keyrecord_t *record) {
// skip anything that isn't a keyup
if (!record->event.pressed) {
return true;
}
if (record->event.pressed) {
switch (keycode) {
case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_ALT_GUI:
case MAGIC_SWAP_LCTL_LGUI ... MAGIC_EE_HANDS_RIGHT:
/* keymap config */
keymap_config.raw = eeconfig_read_keymap();
switch (keycode) {
@ -164,13 +164,15 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) {
case MAGIC_EE_HANDS_RIGHT:
eeconfig_update_handedness(false);
break;
default:
// Not a magic keycode so continue processing
return true;
}
eeconfig_update_keymap(keymap_config.raw);
clear_keyboard(); // clear to prevent stuck keys
return false;
}
}
// Not a magic keycode so continue processing
return true;
}

@ -254,6 +254,7 @@ void keyboard_init(void) {
#endif
#if defined(NKRO_ENABLE) && defined(FORCE_NKRO)
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
#endif
keyboard_post_init_kb(); /* Always keep this last */
}

Loading…
Cancel
Save