X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=common%2Faction_code.h;h=8df86b11929e5afa8de07edb839c39d69defa6f3;hb=77e946432e22382ad1bae8da05af87611006efab;hp=d28b74f843e5892cf022d3fb54a9ece881037a3c;hpb=1eb8523e9506c752fb726208d8853a82f06e6659;p=max%2Ftmk_keyboard.git
diff --git a/common/action_code.h b/common/action_code.h
index d28b74f8..8df86b11 100644
--- a/common/action_code.h
+++ b/common/action_code.h
@@ -29,13 +29,14 @@ along with this program. If not, see .
* 000r|0000|0000 0001 Transparent code
* 000r|0000| keycode Key
* 000r|mods|0000 0000 Modifiers
- * 000r|mods| keycode Key and Modifiers
+ * 000r|mods| keycode Modifiers+Key(Modified key)
* r: Left/Right flag(Left:0, Right:1)
*
* ACT_MODS_TAP(001r):
- * 0010|mods|0000 0000 Modifiers with OneShot
- * 0010|mods|0000 00xx (reserved)
- * 0010|mods| keycode Modifiers with Tap Key
+ * 001r|mods|0000 0000 Modifiers with OneShot
+ * 001r|mods|0000 0001 Modifiers with tap toggle
+ * 001r|mods|0000 00xx (reserved)
+ * 001r|mods| keycode Modifiers with Tap Key(Dual role)
*
*
* Other Keys(01xx)
@@ -62,21 +63,21 @@ along with this program. If not, see .
* 1000|ooee|pppE BBBB Layer Bitwise Operation
* oo: operation(00:AND, 01:OR, 10:XOR, 11:SET)
* ppp: 4-bit chunk part(0-7)
- * eBBBB: bits and extra bit
- * ee: on event(00:default layer, 01:press, 10:release, 11:both)
+ * EBBBB: bits and extra bit
+ * ee: on event(01:press, 10:release, 11:both)
*
* 1001|xxxx|xxxx xxxx (reserved)
* 1001|oopp|BBBB BBBB 8-bit Bitwise Operation???
*
* ACT_LAYER_TAP(101x):
- * 101E|LLLL| keycode Invert with tap key
+ * 101E|LLLL| keycode On/Off with tap key
* 101E|LLLL|1110 xxxx Reserved(0xE0-EF)
* 101E|LLLL|1111 0000 Invert with tap toggle(0xF0)
* 101E|LLLL|1111 0001 On/Off
* 101E|LLLL|1111 0010 Off/On
* 101E|LLLL|1111 0011 Set/Clear
* 101E|LLLL|1111 xxxx Reserved(0xF4-FF)
- * ELLLL: layer(0-31)
+ * ELLLL: layer 0-31(E: extra bit for layer 16-31)
*
*
* Extensions(11xx)
@@ -86,7 +87,7 @@ along with this program. If not, see .
* 1100|1111| id(8) Macro record?
*
* ACT_BACKLIGHT(1101):
- * 1110|xxxx| id(8) Backlight commands
+ * 1101|xxxx| id(8) Backlight commands
*
* ACT_COMMAND(1110):
* 1110|opt | id(8) Built-in Command exec
@@ -108,8 +109,8 @@ enum action_kind_id {
ACT_MOUSEKEY = 0b0101,
/* Layer Actions */
ACT_LAYER = 0b1000,
- ACT_LAYER_TAP = 0b1010,
- ACT_LAYER_TAP1 = 0b1011,
+ ACT_LAYER_TAP = 0b1010, /* Layer 0-15 */
+ ACT_LAYER_TAP_EXT = 0b1011, /* Layer 16-31 */
/* Extensions */
ACT_MACRO = 0b1100,
ACT_BACKLIGHT = 0b1101,
@@ -205,12 +206,14 @@ enum mods_bit {
};
enum mods_codes {
MODS_ONESHOT = 0x00,
+ MODS_TAP_TOGGLE = 0x01,
};
#define ACTION_KEY(key) ACTION(ACT_MODS, (key))
-#define ACTION_MODS(mods) ACTION(ACT_MODS, (mods)<<8 | 0)
-#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, (mods)<<8 | (key))
-#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, (mods)<<8 | (key))
-#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, (mods)<<8 | MODS_ONESHOT)
+#define ACTION_MODS(mods) ACTION(ACT_MODS, ((mods)&0x1f)<<8 | 0)
+#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, ((mods)&0x1f)<<8 | (key))
+#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | (key))
+#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_ONESHOT)
+#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f)<<8 | MODS_TAP_TOGGLE)
/*