summaryrefslogtreecommitdiff
path: root/common/layer_switch.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-02-16 04:05:58 +0900
committertmk <nobody@nowhere>2013-02-16 04:08:31 +0900
commite324fa29187dff7868d9d7fd378e0e46d77107a5 (patch)
treea72966995df47eef01ced9873c14f972de8af069 /common/layer_switch.h
parent0142b571c46c7db314063615c956cbc5ec9720f1 (diff)
downloadqmk_firmware-e324fa29187dff7868d9d7fd378e0e46d77107a5.tar.gz
qmk_firmware-e324fa29187dff7868d9d7fd378e0e46d77107a5.zip
Rewrite layer action with layer_switch
Diffstat (limited to 'common/layer_switch.h')
-rw-r--r--common/layer_switch.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/common/layer_switch.h b/common/layer_switch.h
index 9f0695260c..25c81a5dc2 100644
--- a/common/layer_switch.h
+++ b/common/layer_switch.h
@@ -21,16 +21,39 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keyboard.h"
#include "action.h"
-uint16_t layer_switch_stat;
-uint16_t layer_switch_stat_get(void);
-void layer_switch_stat_set(uint16_t stat);
+/* base layer to fall back */
+extern uint8_t default_layer;
+
+/* layer status */
+extern uint16_t layer_switch_stat;
+
+/* return layer status */
+uint16_t layer_switch_get_stat(void);
+/* return current active layer */
+uint8_t layer_switch_get_layer(void);
+
+/* switch off all layers */
void layer_switch_clear(void);
+/* set layer status */
+void layer_switch_set(uint16_t stat);
+/* move to layer */
+void layer_switch_move(uint8_t layer);
+/* switch on layer */
void layer_switch_on(uint8_t layer);
+/* switch off layer */
void layer_switch_off(uint8_t layer);
-/* invert state */
-void layer_switch_inv(uint8_t layer);
+/* switch state of layer */
+void layer_switch_invert(uint8_t layer);
+
+/* bitwise operation against layer status */
+void layer_switch_or(uint16_t stat);
+void layer_switch_and(uint16_t stat);
+void layer_switch_xor(uint16_t stat);
+
void layer_switch_debug(void);
+
+/* return action depending on current layer status */
action_t layer_switch_get_action(key_t key);
#endif