summaryrefslogtreecommitdiffstats
path: root/tmk_core/common/action_code.h
diff options
context:
space:
mode:
authorJoe Wasson <jwasson+github@gmail.com>2016-07-27 17:43:02 +0200
committerJoe Wasson <jwasson+github@gmail.com>2016-08-21 02:46:53 +0200
commitdd378601608849679ead6e2cccb74f7f29c131dc (patch)
treeb8142400df6c9611a9b3e50aba2c78be1fb7db4e /tmk_core/common/action_code.h
parenta3f726174c0f8f358f7970767a1bf743fd9ad761 (diff)
downloadqmk_firmware-dd378601608849679ead6e2cccb74f7f29c131dc.tar.gz
qmk_firmware-dd378601608849679ead6e2cccb74f7f29c131dc.tar.xz
Add one-hand support.
This adds an action, `ACTION_SWAP_HANDS`, that swaps the the keys on the keyboard across a keymap-defined hemisphere in order to support one-hand typing without requiring a separate one-handed layer. See updated `doc/keymap.md` for more information.
Diffstat (limited to 'tmk_core/common/action_code.h')
-rw-r--r--tmk_core/common/action_code.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h
index ca729aaec..95d2cbf3e 100644
--- a/tmk_core/common/action_code.h
+++ b/tmk_core/common/action_code.h
@@ -295,6 +295,10 @@ enum backlight_opt {
BACKLIGHT_STEP = 3,
BACKLIGHT_LEVEL = 4,
};
+
+enum command_id {
+ CMD_SWAP_HANDS = 0x14,
+};
/* Macro */
#define ACTION_MACRO(id) ACTION(ACT_MACRO, (id))
#define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id))
@@ -306,7 +310,7 @@ enum backlight_opt {
#define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8)
#define ACTION_BACKLIGHT_LEVEL(level) ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | (level))
/* Command */
-#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (addr))
+#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (id))
/* Function */
enum function_opts {
FUNC_TAP = 0x8, /* indciates function is tappable */
@@ -314,5 +318,7 @@ enum function_opts {
#define ACTION_FUNCTION(id) ACTION(ACT_FUNCTION, (id))
#define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | (id))
#define ACTION_FUNCTION_OPT(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | (id))
+/* OneHand Support */
+#define ACTION_SWAP_HANDS() ACTION_COMMAND(CMD_SWAP_HANDS, 0)
#endif /* ACTION_CODE_H */