mirror of
https://github.com/firewalkwithm3/qmk_firmware.git
synced 2024-11-22 11:30:30 +08:00
Fix FORCE_NKRO handling (#7601)
This commit is contained in:
parent
071eb2478f
commit
efb21c00ce
|
@ -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,9 +164,6 @@ 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);
|
||||
|
@ -174,3 +171,8 @@ bool process_magic(uint16_t keycode, keyrecord_t *record) {
|
|||
|
||||
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…
Reference in a new issue