aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/action_util.h
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2020-05-13 23:36:55 +0200
committerGitHub <noreply@github.com>2020-05-14 07:36:55 +1000
commit805f5cb72bb04c10327b40ed0c41e3848ad9ca75 (patch)
tree249680bec133e18dd2399b80cbeb14e980f1095c /tmk_core/common/action_util.h
parenta8a8bf0ff3d6e1c9637079b925b30cf7eb8913fd (diff)
downloadqmk_firmware-805f5cb72bb04c10327b40ed0c41e3848ad9ca75.tar.gz
qmk_firmware-805f5cb72bb04c10327b40ed0c41e3848ad9ca75.zip
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
Diffstat (limited to 'tmk_core/common/action_util.h')
-rw-r--r--tmk_core/common/action_util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/tmk_core/common/action_util.h b/tmk_core/common/action_util.h
index 1ce03ed0e..5dd8393da 100644
--- a/tmk_core/common/action_util.h
+++ b/tmk_core/common/action_util.h
@@ -77,6 +77,7 @@ void reset_oneshot_layer(void);
77bool is_oneshot_layer_active(void); 77bool is_oneshot_layer_active(void);
78uint8_t get_oneshot_layer_state(void); 78uint8_t get_oneshot_layer_state(void);
79bool has_oneshot_layer_timed_out(void); 79bool has_oneshot_layer_timed_out(void);
80bool has_oneshot_swaphands_timed_out(void);
80 81
81void oneshot_locked_mods_changed_user(uint8_t mods); 82void oneshot_locked_mods_changed_user(uint8_t mods);
82void oneshot_locked_mods_changed_kb(uint8_t mods); 83void oneshot_locked_mods_changed_kb(uint8_t mods);
@@ -88,6 +89,13 @@ void oneshot_layer_changed_kb(uint8_t layer);
88/* inspect */ 89/* inspect */
89uint8_t has_anymod(void); 90uint8_t has_anymod(void);
90 91
92#ifdef SWAP_HANDS_ENABLE
93void set_oneshot_swaphands(void);
94void release_oneshot_swaphands(void);
95void use_oneshot_swaphands(void);
96void clear_oneshot_swaphands(void);
97#endif
98
91#ifdef __cplusplus 99#ifdef __cplusplus
92} 100}
93#endif 101#endif