Skip to content

Commit

Permalink
Merge pull request #6 from IBNobody/fix_magic_key_binding_NKRO
Browse files Browse the repository at this point in the history
Set keyboard_nkro (used by TMK) w/ MAGIC_HOST_NKRO
  • Loading branch information
IBNobody authored Sep 6, 2016
2 parents 91e0f62 + e571d46 commit f0388a5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ static void do_code16 (uint16_t code, void (*f) (uint8_t)) {
f(KC_RGUI);
}

#ifdef NKRO_ENABLE
extern bool keyboard_nkro;
#endif

void register_code16 (uint16_t code) {
do_code16 (code, register_code);
register_code (code);
Expand Down Expand Up @@ -223,6 +227,11 @@ bool process_record_quantum(keyrecord_t *record) {
keymap_config.swap_backslash_backspace = 1;
} else if (keycode == MAGIC_HOST_NKRO) {
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) {
keymap_config.swap_lalt_lgui = 1;
keymap_config.swap_ralt_rgui = 1;
Expand All @@ -244,6 +253,10 @@ bool process_record_quantum(keyrecord_t *record) {
keymap_config.swap_backslash_backspace = 0;
} else if (keycode == MAGIC_UNHOST_NKRO) {
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) {
keymap_config.swap_lalt_lgui = 0;
keymap_config.swap_ralt_rgui = 0;
Expand Down

0 comments on commit f0388a5

Please sign in to comment.