]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/common/action_code.h
hhkb: Revise doc
[max/tmk_keyboard.git] / tmk_core / common / action_code.h
index 8dad38b961d8639e182be2a53b7fa3589be6d270..4b664286ec01ec4c1a78fad203dee7d6fecd41d9 100644 (file)
@@ -29,14 +29,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * 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 <http://www.gnu.org/licenses/>.
  * 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,6 +200,7 @@ typedef union {
  *   bit 4      +----- LR flag(Left:0, Right:1)
  */
 enum mods_bit {
+    MOD_NONE = 0x00,
     MOD_LCTL = 0x01,
     MOD_LSFT = 0x02,
     MOD_LALT = 0x04,
@@ -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)&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)