diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-08-23 00:29:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 00:29:46 -0400 |
commit | fb4452c2f5a80720fd56306ea4fa7c61a5e8040d (patch) | |
tree | 1568da3302d7afea44b21a59b4e75ad17702751b /tmk_core/common/action.h | |
parent | 57125ce790843799a420a13a9f08b8b072b546e5 (diff) | |
parent | c20bf83afd698a4535fa1b8df901f6ab1e3cb532 (diff) |
Merge pull request #671 from Talljoe/one-hand
Add native one-handed support
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 e8aa12a7cb..b9bdfe642c 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -65,6 +65,24 @@ bool process_record_quantum(keyrecord_t *record); #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) extern bool disable_action_cache; #endif + +/* Code for handling one-handed key modifiers. */ +#ifdef ONEHAND_ENABLE +extern bool swap_hands; +extern const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS]; +#if (MATRIX_COLS <= 8) +typedef uint8_t swap_state_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t swap_state_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t swap_state_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +void process_hand_swap(keyevent_t *record); +#endif + void process_record_nocache(keyrecord_t *record); void process_record(keyrecord_t *record); void process_action(keyrecord_t *record, action_t action); |