forked from mirrors/qmk_userspace
One shot support for swap hands (#8590)
This commits add the SH_OS keycode, which works similarly to one shot layers: * while pressed, the keyboard is swapped * if no keys were pressed while it was pressed, the next key press is swapped SH_OS also supports chaining with one shot layers: OSL(x) + SH_OS + key interprets the key press on the oneshot layer. The ONESHOT_TIMEOUT setting used by one shot keys and layers is also used by oneshot swap hands. In the above chaining scenario the timeout of the oneshot layer is reset when swap hands is activated. Resolves #2682
This commit is contained in:
parent
a8a8bf0ff3
commit
805f5cb72b
7 changed files with 93 additions and 1 deletions
|
@ -294,11 +294,13 @@ enum swap_hands_param_tap_op {
|
|||
OP_SH_OFF_ON,
|
||||
OP_SH_OFF,
|
||||
OP_SH_ON,
|
||||
OP_SH_ONESHOT,
|
||||
};
|
||||
|
||||
#define ACTION_SWAP_HANDS() ACTION_SWAP_HANDS_ON_OFF()
|
||||
#define ACTION_SWAP_HANDS_TOGGLE() ACTION(ACT_SWAP_HANDS, OP_SH_TOGGLE)
|
||||
#define ACTION_SWAP_HANDS_TAP_TOGGLE() ACTION(ACT_SWAP_HANDS, OP_SH_TAP_TOGGLE)
|
||||
#define ACTION_SWAP_HANDS_ONESHOT() ACTION(ACT_SWAP_HANDS, OP_SH_ONESHOT)
|
||||
#define ACTION_SWAP_HANDS_TAP_KEY(key) ACTION(ACT_SWAP_HANDS, key)
|
||||
#define ACTION_SWAP_HANDS_ON_OFF() ACTION(ACT_SWAP_HANDS, OP_SH_ON_OFF)
|
||||
#define ACTION_SWAP_HANDS_OFF_ON() ACTION(ACT_SWAP_HANDS, OP_SH_OFF_ON)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue