summaryrefslogtreecommitdiff
path: root/common/layer_switch.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-03-31 22:47:19 +0900
committertmk <nobody@nowhere>2013-03-31 22:47:19 +0900
commit10f33a3e484e24065ed5eaab1c56c35156bace89 (patch)
tree8b938962644ad2d04261655bc9487984e86e4996 /common/layer_switch.c
parent353a9b56e6caee853d3f808d2bfedf07056b4518 (diff)
Remove ACT_KEYMAP and ACT_OVERLAY
- Remove ACT_OVERLAY - Rename ACT_KEYMAP to ACT_LAYER - Add ACT_LAYER_BITOP
Diffstat (limited to 'common/layer_switch.c')
-rw-r--r--common/layer_switch.c90
1 files changed, 2 insertions, 88 deletions
diff --git a/common/layer_switch.c b/common/layer_switch.c
index a5d426a899..359e6b9d84 100644
--- a/common/layer_switch.c
+++ b/common/layer_switch.c
@@ -24,7 +24,7 @@ void default_layer_set(uint8_t layer)
}
-#ifndef NO_ACTION_KEYMAP
+#ifndef NO_ACTION_LAYER
/*
* Keymap Layer (0-15)
*/
@@ -100,98 +100,12 @@ void keymap_debug(void)
-#ifndef NO_ACTION_OVERLAY
-/*
- * Overlay Layer (16-31 = 0-15|0x10)
- */
-uint16_t overlay_stat = 0;
-
-/* return highest layer whose state is on */
-uint8_t overlay_get_layer(void)
-{
- return biton16(overlay_stat);
-}
-
-static void overlay_stat_set(uint16_t stat)
-{
- debug("overlay: ");
- overlay_debug(); debug(" to ");
-
- overlay_stat = stat;
-
- overlay_debug(); debug("\n");
-
- clear_keyboard_but_mods(); // To avoid stuck keys
-}
-
-void overlay_clear(void)
-{
- overlay_stat_set(0);
-}
-
-
-void overlay_set(uint16_t stat)
-{
- overlay_stat_set(stat);
-}
-
-void overlay_move(uint8_t layer)
-{
- overlay_stat_set(1<<layer);
-}
-
-void overlay_on(uint8_t layer)
-{
- overlay_stat_set(overlay_stat | (1<<layer));
-}
-
-void overlay_off(uint8_t layer)
-{
- overlay_stat_set(overlay_stat & ~(1<<layer));
-}
-
-void overlay_invert(uint8_t layer)
-{
- overlay_stat_set(overlay_stat ^ (1<<layer));
-}
-
-void overlay_or(uint16_t stat)
-{
- overlay_stat_set(overlay_stat | stat);
-}
-void overlay_and(uint16_t stat)
-{
- overlay_stat_set(overlay_stat & stat);
-}
-void overlay_xor(uint16_t stat)
-{
- overlay_stat_set(overlay_stat ^ stat);
-}
-
-void overlay_debug(void)
-{
- debug_hex16(overlay_stat); debug("("); debug_dec(overlay_get_layer()); debug(")");
-}
-#endif
-
action_t layer_switch_get_action(key_t key)
{
action_t action;
action.code = ACTION_TRANSPARENT;
-#ifndef NO_ACTION_OVERLAY
- /* overlay: top layer first */
- for (int8_t i = 15; i >= 0; i--) {
- if (overlay_stat & (1<<i)) {
- action = action_for_key(i | OVERLAY_BIT, key);
- if (action.code != ACTION_TRANSPARENT) {
- return action;
- }
- }
- }
-#endif
-
-#ifndef NO_ACTION_KEYMAP
+#ifndef NO_ACTION_LAYER
/* keymap: top layer first */
for (int8_t i = 15; i >= 0; i--) {
if (keymap_stat & (1<<i)) {