diff options
author | Joe Wasson <jwasson+github@gmail.com> | 2016-07-27 08:43:02 -0700 |
---|---|---|
committer | Joe Wasson <jwasson+github@gmail.com> | 2016-08-20 17:46:53 -0700 |
commit | dd378601608849679ead6e2cccb74f7f29c131dc (patch) | |
tree | b8142400df6c9611a9b3e50aba2c78be1fb7db4e /tmk_core/common/action.h | |
parent | a3f726174c0f8f358f7970767a1bf743fd9ad761 (diff) | |
download | qmk_firmware-dd378601608849679ead6e2cccb74f7f29c131dc.tar.gz qmk_firmware-dd378601608849679ead6e2cccb74f7f29c131dc.zip |
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.h')
-rw-r--r-- | tmk_core/common/action.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index e8aa12a7c..b9bdfe642 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h | |||
@@ -65,6 +65,24 @@ bool process_record_quantum(keyrecord_t *record); | |||
65 | #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) | 65 | #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) |
66 | extern bool disable_action_cache; | 66 | extern bool disable_action_cache; |
67 | #endif | 67 | #endif |
68 | |||
69 | /* Code for handling one-handed key modifiers. */ | ||
70 | #ifdef ONEHAND_ENABLE | ||
71 | extern bool swap_hands; | ||
72 | extern const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS]; | ||
73 | #if (MATRIX_COLS <= 8) | ||
74 | typedef uint8_t swap_state_row_t; | ||
75 | #elif (MATRIX_COLS <= 16) | ||
76 | typedef uint16_t swap_state_row_t; | ||
77 | #elif (MATRIX_COLS <= 32) | ||
78 | typedef uint32_t swap_state_row_t; | ||
79 | #else | ||
80 | #error "MATRIX_COLS: invalid value" | ||
81 | #endif | ||
82 | |||
83 | void process_hand_swap(keyevent_t *record); | ||
84 | #endif | ||
85 | |||
68 | void process_record_nocache(keyrecord_t *record); | 86 | void process_record_nocache(keyrecord_t *record); |
69 | void process_record(keyrecord_t *record); | 87 | void process_record(keyrecord_t *record); |
70 | void process_action(keyrecord_t *record, action_t action); | 88 | void process_action(keyrecord_t *record, action_t action); |