1
0
Fork 0

Fix FORCE_NKRO handling (#7601)

This commit is contained in:
Joel Challis 2019-12-11 19:39:30 +00:00 committed by Drashna Jaelre
parent 071eb2478f
commit efb21c00ce
2 changed files with 135 additions and 132 deletions

View file

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

View file

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