]> git.gir.st - tmk_keyboard.git/blob - common/layer_switch.h
Remove ACT_KEYMAP and ACT_OVERLAY
[tmk_keyboard.git] / common / layer_switch.h
1 /*
2 Copyright 2013 Jun Wako <wakojun@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef LAYER_SWITCH_H
18 #define LAYER_SWITCH_H
19
20 #include <stdint.h>
21 #include "keyboard.h"
22 #include "action.h"
23
24
25 /*
26 * Default Layer
27 */
28 /* base layer to fall back */
29 extern uint8_t default_layer;
30 void default_layer_set(uint8_t layer);
31
32
33 /*
34 * Keymap Layer
35 */
36 #ifndef NO_ACTION_LAYER
37 extern uint16_t keymap_stat;
38 /* return current active layer */
39 uint8_t keymap_get_layer(void);
40 void keymap_clear(void);
41 void keymap_set(uint16_t stat);
42 void keymap_move(uint8_t layer);
43 void keymap_on(uint8_t layer);
44 void keymap_off(uint8_t layer);
45 void keymap_invert(uint8_t layer);
46 /* bitwise operation */
47 void keymap_or(uint16_t stat);
48 void keymap_and(uint16_t stat);
49 void keymap_xor(uint16_t stat);
50 void keymap_debug(void);
51 #else
52 #define keymap_stat 0
53 #define keymap_get_layer()
54 #define keymap_clear()
55 #define keymap_set(stat)
56 #define keymap_move(layer)
57 #define keymap_on(layer)
58 #define keymap_off(layer)
59 #define keymap_invert(layer)
60 #define keymap_or(stat)
61 #define keymap_and(stat)
62 #define keymap_xor(stat)
63 #define keymap_debug()
64 #endif
65
66
67 /* return action depending on current layer status */
68 action_t layer_switch_get_action(key_t key);
69
70 #endif
Imprint / Impressum