aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/action.c9
-rw-r--r--common/command.c2
2 files changed, 3 insertions, 8 deletions
diff --git a/common/action.c b/common/action.c
index 158522dd0..065188744 100644
--- a/common/action.c
+++ b/common/action.c
@@ -72,22 +72,17 @@ void process_action(keyrecord_t *record)
72 uint8_t mods = (action.kind.id == ACT_LMODS) ? action.key.mods : 72 uint8_t mods = (action.kind.id == ACT_LMODS) ? action.key.mods :
73 action.key.mods<<4; 73 action.key.mods<<4;
74 if (event.pressed) { 74 if (event.pressed) {
75 uint8_t tmp_mods = host_get_mods();
76 if (mods) { 75 if (mods) {
77 host_add_mods(mods); 76 host_add_mods(mods);
78 host_send_keyboard_report(); 77 host_send_keyboard_report();
79 } 78 }
80 register_code(action.key.code); 79 register_code(action.key.code);
81 if (mods && action.key.code) {
82 host_set_mods(tmp_mods);
83 host_send_keyboard_report();
84 }
85 } else { 80 } else {
86 if (mods && !action.key.code) { 81 unregister_code(action.key.code);
82 if (mods) {
87 host_del_mods(mods); 83 host_del_mods(mods);
88 host_send_keyboard_report(); 84 host_send_keyboard_report();
89 } 85 }
90 unregister_code(action.key.code);
91 } 86 }
92 } 87 }
93 break; 88 break;
diff --git a/common/command.c b/common/command.c
index dc06c6da3..3a1fcb186 100644
--- a/common/command.c
+++ b/common/command.c
@@ -574,7 +574,7 @@ static uint8_t numkey2num(uint8_t code)
574static void switch_default_layer(uint8_t layer) 574static void switch_default_layer(uint8_t layer)
575{ 575{
576 print("switch_default_layer: "); print_dec(biton32(default_layer_state)); 576 print("switch_default_layer: "); print_dec(biton32(default_layer_state));
577 print(" to "); print_dec(layer); print("\n");
577 default_layer_set(layer); 578 default_layer_set(layer);
578 print(" to "); print_dec(biton32(default_layer_state)); print("\n");
579 clear_keyboard(); 579 clear_keyboard();
580} 580}