summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-02-12 17:15:24 +0900
committertmk <nobody@nowhere>2013-02-12 17:15:24 +0900
commitf02431e9da2158ff8a8508629b86329fef0ba24a (patch)
treef4b0e02532958f5a4c1d207f51385d01f3a78e96 /common
parent77af88042a0622946d7af7aff489cc6e18469104 (diff)
Fix 'chage default layer' command.
Diffstat (limited to 'common')
-rw-r--r--common/command.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/common/command.c b/common/command.c
index 6d4e4c642d..7bb2a23f19 100644
--- a/common/command.c
+++ b/common/command.c
@@ -263,23 +263,16 @@ static bool command_common(uint8_t code)
#endif
case KC_0:
case KC_F10:
+ clear_keyboard();
switch_layer(0);
break;
- case KC_1:
- case KC_F1:
- switch_layer(1);
- break;
- case KC_2:
- case KC_F2:
- switch_layer(2);
- break;
- case KC_3:
- case KC_F3:
- switch_layer(3);
+ case KC_1 ... KC_9:
+ clear_keyboard();
+ switch_layer((code - KC_1) + 1);
break;
- case KC_4:
- case KC_F4:
- switch_layer(4);
+ case KC_F1 ... KC_F9:
+ clear_keyboard();
+ switch_layer((code - KC_F1) + 1);
break;
default:
print("?");