|
@@ -98,6 +98,11 @@ void action_exec(keyevent_t event) {
|
|
if (has_oneshot_mods_timed_out()) {
|
|
if (has_oneshot_mods_timed_out()) {
|
|
clear_oneshot_mods();
|
|
clear_oneshot_mods();
|
|
}
|
|
}
|
|
|
|
+# ifdef SWAP_HANDS_ENABLE
|
|
|
|
+ if (has_oneshot_swaphands_timed_out()) {
|
|
|
|
+ clear_oneshot_swaphands();
|
|
|
|
+ }
|
|
|
|
+# endif
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -165,6 +170,8 @@ void process_record_tap_hint(keyrecord_t *record) {
|
|
# ifdef SWAP_HANDS_ENABLE
|
|
# ifdef SWAP_HANDS_ENABLE
|
|
case ACT_SWAP_HANDS:
|
|
case ACT_SWAP_HANDS:
|
|
switch (action.swap.code) {
|
|
switch (action.swap.code) {
|
|
|
|
+ case OP_SH_ONESHOT:
|
|
|
|
+ break;
|
|
case OP_SH_TAP_TOGGLE:
|
|
case OP_SH_TAP_TOGGLE:
|
|
default:
|
|
default:
|
|
swap_hands = !swap_hands;
|
|
swap_hands = !swap_hands;
|
|
@@ -224,7 +231,11 @@ void process_action(keyrecord_t *record, action_t action) {
|
|
#ifndef NO_ACTION_ONESHOT
|
|
#ifndef NO_ACTION_ONESHOT
|
|
bool do_release_oneshot = false;
|
|
bool do_release_oneshot = false;
|
|
// notice we only clear the one shot layer if the pressed key is not a modifier.
|
|
// notice we only clear the one shot layer if the pressed key is not a modifier.
|
|
- if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)) {
|
|
|
|
|
|
+ if (is_oneshot_layer_active() && event.pressed && !IS_MOD(action.key.code)
|
|
|
|
+# ifdef SWAP_HANDS_ENABLE
|
|
|
|
+ && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT)
|
|
|
|
+# endif
|
|
|
|
+ ) {
|
|
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
|
|
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
|
|
do_release_oneshot = !is_oneshot_layer_active();
|
|
do_release_oneshot = !is_oneshot_layer_active();
|
|
}
|
|
}
|
|
@@ -593,6 +604,14 @@ void process_action(keyrecord_t *record, action_t action) {
|
|
swap_hands = false;
|
|
swap_hands = false;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+ case OP_SH_ONESHOT:
|
|
|
|
+ if (event.pressed) {
|
|
|
|
+ set_oneshot_swaphands();
|
|
|
|
+ } else {
|
|
|
|
+ release_oneshot_swaphands();
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+
|
|
# ifndef NO_ACTION_TAPPING
|
|
# ifndef NO_ACTION_TAPPING
|
|
case OP_SH_TAP_TOGGLE:
|
|
case OP_SH_TAP_TOGGLE:
|
|
/* tap toggle */
|
|
/* tap toggle */
|
|
@@ -681,6 +700,12 @@ void process_action(keyrecord_t *record, action_t action) {
|
|
# endif
|
|
# endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef SWAP_HANDS_ENABLE
|
|
|
|
+ if (event.pressed && !(action.kind.id == ACT_SWAP_HANDS && action.swap.code == OP_SH_ONESHOT)) {
|
|
|
|
+ use_oneshot_swaphands();
|
|
|
|
+ }
|
|
|
|
+#endif
|
|
|
|
+
|
|
#ifndef NO_ACTION_ONESHOT
|
|
#ifndef NO_ACTION_ONESHOT
|
|
/* Because we switch layers after a oneshot event, we need to release the
|
|
/* Because we switch layers after a oneshot event, we need to release the
|
|
* key before we leave the layer or no key up event will be generated.
|
|
* key before we leave the layer or no key up event will be generated.
|