summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-08-08 16:41:10 -0700
committerGitHub <noreply@github.com>2020-08-08 16:41:10 -0700
commitc7b56bee96b17a84a3de372117394b62191e22ce (patch)
tree04403c43ee743d1c5dfaead629a6fc7f53e234bd
parentb506c498a789563511f59c8c902e9d9f6a1daaa4 (diff)
downloadqmk_firmware-c7b56bee96b17a84a3de372117394b62191e22ce.tar.gz
qmk_firmware-c7b56bee96b17a84a3de372117394b62191e22ce.zip
[Bug] Fix Swap Hands bug introduced by OSH (#9968)
Fixes the handling for the oneshot cleanup, so it only cleans up if it is active. It should not cleanup of SHO is off (eg using a normal oneshot key), nor if it's actively pressed or used. Previous behavior BROKE swap hand key.
-rw-r--r--tmk_core/common/action_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tmk_core/common/action_util.c b/tmk_core/common/action_util.c
index 371acfa610..fd0e4409f0 100644
--- a/tmk_core/common/action_util.c
+++ b/tmk_core/common/action_util.c
@@ -97,7 +97,7 @@ static uint16_t oneshot_layer_time = 0;
inline bool has_oneshot_layer_timed_out() { return TIMER_DIFF_16(timer_read(), oneshot_layer_time) >= ONESHOT_TIMEOUT && !(get_oneshot_layer_state() & ONESHOT_TOGGLED); }
# ifdef SWAP_HANDS_ENABLE
static uint16_t oneshot_swaphands_time = 0;
-inline bool has_oneshot_swaphands_timed_out() { return TIMER_DIFF_16(timer_read(), oneshot_swaphands_time) >= ONESHOT_TIMEOUT && !(swap_hands_oneshot >= SHO_PRESSED); }
+inline bool has_oneshot_swaphands_timed_out() { return TIMER_DIFF_16(timer_read(), oneshot_swaphands_time) >= ONESHOT_TIMEOUT && (swap_hands_oneshot == SHO_ACTIVE); }
# endif
# endif