From cc8e66754b1a5d0c11985cb0feb51ead49668744 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 2 Apr 2013 16:09:43 +0900 Subject: Refine ACT_LAYER and ACT_LAYER_TAP - Remove ACT_LAYER_BITOP --- common/action.h | 166 +++++++++++++++++++++++++------------------------------- 1 file changed, 75 insertions(+), 91 deletions(-) (limited to 'common/action.h') diff --git a/common/action.h b/common/action.h index 2c4f306a44..4daae1d04f 100644 --- a/common/action.h +++ b/common/action.h @@ -63,11 +63,19 @@ typedef union { uint8_t mods :4; uint8_t kind :4; } key; - struct action_layer { + struct action_layer_bitop { + uint8_t bits :4; + uint8_t xbit :1; + uint8_t part :3; + uint8_t on :2; + uint8_t op :2; + uint8_t kind :4; + } layer_bitop; + struct action_layer_tap { uint8_t code :8; uint8_t val :5; uint8_t kind :3; - } layer; + } layer_tap; struct action_usage { uint16_t code :10; uint8_t page :2; @@ -170,40 +178,27 @@ void debug_action(action_t action); * * Layer Actions(10XX) * ------------------- - * ACT_LAYER: - * 1000|--xx|0000 0000 Clear keyamp - * 100X|LLLL|0000 00xx Reset default layer and clear keymap - * 100X|LLLL| keycode Invert with tap key - * 100X|LLLL|1111 0000 Invert with tap toggle - * 100X|LLLL|1111 00xx Invert[^= 1<>(0bBB*8)) & 0xff) BITOP 0bxxxxxxxx)<<(0bBB*8) - * layer_state: 32-bit layer switch state * * * @@ -234,9 +229,8 @@ enum action_kind_id { ACT_MOUSEKEY = 0b0101, ACT_LAYER = 0b1000, - ACT_LAYER1 = 0b1001, - ACT_LAYER_BITOP = 0b1010, - ACT_LAYER1_BITOP = 0b1011, + ACT_LAYER_TAP = 0b1010, + ACT_LAYER_TAP1 = 0b1011, ACT_MACRO = 0b1100, ACT_COMMAND = 0b1110, @@ -289,71 +283,61 @@ enum usage_pages { -/* Layer Actions: - * Invert layer ^= (1<