]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
Fix ACT_MODS action and switch_default_layer command
authortmk <nobody@nowhere>
Thu, 4 Apr 2013 07:29:44 +0000 (16:29 +0900)
committertmk <nobody@nowhere>
Thu, 4 Apr 2013 07:29:44 +0000 (16:29 +0900)
common/action.c
common/command.c

index 158522dd034518f51f653cb3f0a7d1da3df24e10..0651887444c4db8fda91e51ff73a655d9c04f174 100644 (file)
@@ -72,22 +72,17 @@ void process_action(keyrecord_t *record)
                 uint8_t mods = (action.kind.id == ACT_LMODS) ?  action.key.mods :
                                                                 action.key.mods<<4;
                 if (event.pressed) {
-                    uint8_t tmp_mods = host_get_mods();
                     if (mods) {
                         host_add_mods(mods);
                         host_send_keyboard_report();
                     }
                     register_code(action.key.code);
-                    if (mods && action.key.code) {
-                        host_set_mods(tmp_mods);
-                        host_send_keyboard_report();
-                    }
                 } else {
-                    if (mods && !action.key.code) {
+                    unregister_code(action.key.code);
+                    if (mods) {
                         host_del_mods(mods);
                         host_send_keyboard_report();
                     }
-                    unregister_code(action.key.code);
                 }
             }
             break;
index dc06c6da35d642d7d5ae42a940dfeed308ae68ac..3a1fcb186e1b82c8ac9e6881c8406722f2ec29fa 100644 (file)
@@ -574,7 +574,7 @@ static uint8_t numkey2num(uint8_t code)
 static void switch_default_layer(uint8_t layer)
 {
     print("switch_default_layer: "); print_dec(biton32(default_layer_state));
+    print(" to "); print_dec(layer); print("\n");
     default_layer_set(layer);
-    print(" to "); print_dec(biton32(default_layer_state)); print("\n");
     clear_keyboard();
 }