aboutsummaryrefslogtreecommitdiff
path: root/common/action.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-04-04 16:29:44 +0900
committertmk <nobody@nowhere>2013-04-04 16:29:44 +0900
commitf9a7e224a4de28e52d268c801dc12c8de8c79b3f (patch)
tree063e0e4db5a4eaa1342a6ba8f20352a08b4e9b76 /common/action.c
parentebe798f081ce018826dc882a40fc77ec8a0ad023 (diff)
downloadqmk_firmware-f9a7e224a4de28e52d268c801dc12c8de8c79b3f.tar.gz
qmk_firmware-f9a7e224a4de28e52d268c801dc12c8de8c79b3f.zip
Fix ACT_MODS action and switch_default_layer command
Diffstat (limited to 'common/action.c')
-rw-r--r--common/action.c9
1 files changed, 2 insertions, 7 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;