mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-22 16:37:58 +06:00
Merge pull request #6 from IBNobody/fix_magic_key_binding_NKRO
Set keyboard_nkro (used by TMK) w/ MAGIC_HOST_NKRO
This commit is contained in:
commit
f0388a5b13
|
@ -27,6 +27,10 @@ static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
|
||||||
f(KC_RGUI);
|
f(KC_RGUI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NKRO_ENABLE
|
||||||
|
extern bool keyboard_nkro;
|
||||||
|
#endif
|
||||||
|
|
||||||
void register_code16 (uint16_t code) {
|
void register_code16 (uint16_t code) {
|
||||||
do_code16 (code, register_code);
|
do_code16 (code, register_code);
|
||||||
register_code (code);
|
register_code (code);
|
||||||
|
@ -223,6 +227,11 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||||
keymap_config.swap_backslash_backspace = 1;
|
keymap_config.swap_backslash_backspace = 1;
|
||||||
} else if (keycode == MAGIC_HOST_NKRO) {
|
} else if (keycode == MAGIC_HOST_NKRO) {
|
||||||
keymap_config.nkro = 1;
|
keymap_config.nkro = 1;
|
||||||
|
|
||||||
|
#ifdef NKRO_ENABLE
|
||||||
|
clear_keyboard(); // clear to prevent stuck keys
|
||||||
|
keyboard_nkro = keymap_config.nkro;
|
||||||
|
#endif
|
||||||
} else if (keycode == MAGIC_SWAP_ALT_GUI) {
|
} else if (keycode == MAGIC_SWAP_ALT_GUI) {
|
||||||
keymap_config.swap_lalt_lgui = 1;
|
keymap_config.swap_lalt_lgui = 1;
|
||||||
keymap_config.swap_ralt_rgui = 1;
|
keymap_config.swap_ralt_rgui = 1;
|
||||||
|
@ -244,6 +253,10 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||||
keymap_config.swap_backslash_backspace = 0;
|
keymap_config.swap_backslash_backspace = 0;
|
||||||
} else if (keycode == MAGIC_UNHOST_NKRO) {
|
} else if (keycode == MAGIC_UNHOST_NKRO) {
|
||||||
keymap_config.nkro = 0;
|
keymap_config.nkro = 0;
|
||||||
|
#ifdef NKRO_ENABLE
|
||||||
|
clear_keyboard(); // clear to prevent stuck keys
|
||||||
|
keyboard_nkro = keymap_config.nkro;
|
||||||
|
#endif
|
||||||
} else if (keycode == MAGIC_UNSWAP_ALT_GUI) {
|
} else if (keycode == MAGIC_UNSWAP_ALT_GUI) {
|
||||||
keymap_config.swap_lalt_lgui = 0;
|
keymap_config.swap_lalt_lgui = 0;
|
||||||
keymap_config.swap_ralt_rgui = 0;
|
keymap_config.swap_ralt_rgui = 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user