X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;ds=sidebyside;f=tmk_core%2Fcommon%2Faction_code.h;h=1eb6910469da7fe3b25243a05da6827bc0de2c85;hb=ec8da5f9f509d838c200ff3d01005a209cad107e;hp=8dad38b961d8639e182be2a53b7fa3589be6d270;hpb=39d4f923cded1dd8f46a03ed757390a77f45e2c4;p=max%2Ftmk_keyboard.git
diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h
index 8dad38b9..1eb69104 100644
--- a/tmk_core/common/action_code.h
+++ b/tmk_core/common/action_code.h
@@ -29,14 +29,15 @@ 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 Modifiers+Key(Modified key)
+ * 000r|mods| keycode Modifiers+key(Modified key)
* r: Left/Right flag(Left:0, Right:1)
*
* ACT_MODS_TAP(001r):
- * 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)
+ * 001r|mods|0000 0000 Modifiers with OneShot[TAP]
+ * 001r|mods|0000 0001 Modifiers with tap toggle[TAP]
+ * 001r|mods|0000 00xx (reserved) (0x02-03)
+ * 001r|mods| keycode Modifiers with tap key(0x04-A4, E0-E7)[TAP]
+ * (reserved) (0xA5-DF, E8-FF)
*
*
* Other Keys(01xx)
@@ -70,13 +71,15 @@ along with this program. If not, see .
* 1001|oopp|BBBB BBBB 8-bit Bitwise Operation???
*
* ACT_LAYER_TAP(101x):
- * 101E|LLLL| keycode On/Off with tap key (0x00-DF)[TAP]
- * 101E|LLLL|1110 mods On/Off with modifiers (0xE0-EF)[NOT TAP]
+ * 101E|LLLL| keycode On/Off with tap key (0x04-A4, E0-E7)[TAP]
+ * 101E|LLLL|110r mods On/Off with modifiers (0xC0-DF)[NOT TAP]
+ * r: Left/Right flag(Left:0, Right:1)
+ * (reserved) (0xA5-BF, E8-EF)
* 101E|LLLL|1111 0000 Invert with tap toggle (0xF0) [TAP]
* 101E|LLLL|1111 0001 On/Off (0xF1) [NOT TAP]
* 101E|LLLL|1111 0010 Off/On (0xF2) [NOT TAP]
* 101E|LLLL|1111 0011 Set/Clear (0xF3) [NOT TAP]
- * 101E|LLLL|1111 xxxx Reserved (0xF4-FF)
+ * 101E|LLLL|1111 xxxx (reserved) (0xF4-FF)
* ELLLL: layer 0-31(E: extra bit for layer 16-31)
*
*
@@ -197,25 +200,26 @@ typedef union {
* bit 4 +----- LR flag(Left:0, Right:1)
*/
enum mods_bit {
- MOD_LCTL = 0x01,
- MOD_LSFT = 0x02,
- MOD_LALT = 0x04,
- MOD_LGUI = 0x08,
- MOD_RCTL = 0x11,
- MOD_RSFT = 0x12,
- MOD_RALT = 0x14,
- MOD_RGUI = 0x18,
+ MOD_NONE = 0x0000,
+ MOD_LCTL = 0x0100,
+ MOD_LSFT = 0x0200,
+ MOD_LALT = 0x0400,
+ MOD_LGUI = 0x0800,
+ MOD_RCTL = 0x1100,
+ MOD_RSFT = 0x1200,
+ MOD_RALT = 0x1400,
+ MOD_RGUI = 0x1800,
};
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)&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)
+#define ACTION_MODS(mods) ACTION(ACT_MODS, ((mods)&0x1f00) | 0)
+#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, ((mods)&0x1f00) | (key))
+#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, ((mods)&0x1f00) | (key))
+#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f00) | MODS_ONESHOT)
+#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f00) | MODS_TAP_TOGGLE)
/*
@@ -267,7 +271,7 @@ enum layer_pram_tap_op {
#define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF)
#define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON)
#define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR)
-#define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xe0 | ((mods)&0x0f))
+#define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xc0 | ((mods>>8)&0x1f))
/* With Tapping */
#define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key))
#define ACTION_LAYER_TAP_TOGGLE(layer) ACTION_LAYER_TAP((layer), OP_TAP_TOGGLE)