diff options
author | Kasimir Pihlasviita <kasimir@pihlasviita.fi> | 2023-04-03 08:38:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 15:38:44 +1000 |
commit | 46844347c4f4b5f8b50ea22dd06c7555a86fc94b (patch) | |
tree | c2e331ae9c46e9dc2764a0992fe3fa9f0b083104 /quantum/action_util.c | |
parent | 1899793f27c9b165b55b28b086bd989f12baf137 (diff) |
Fix OSMs getting stuck (#20034)
Diffstat (limited to 'quantum/action_util.c')
-rw-r--r-- | quantum/action_util.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/quantum/action_util.c b/quantum/action_util.c index 7f7d32887b..034c2ecaae 100644 --- a/quantum/action_util.c +++ b/quantum/action_util.c @@ -46,6 +46,12 @@ static uint8_t oneshot_locked_mods = 0; uint8_t get_oneshot_locked_mods(void) { return oneshot_locked_mods; } +void add_oneshot_locked_mods(uint8_t mods) { + if ((oneshot_locked_mods & mods) != mods) { + oneshot_locked_mods |= mods; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} void set_oneshot_locked_mods(uint8_t mods) { if (mods != oneshot_locked_mods) { oneshot_locked_mods = mods; @@ -58,6 +64,12 @@ void clear_oneshot_locked_mods(void) { oneshot_locked_mods_changed_kb(oneshot_locked_mods); } } +void del_oneshot_locked_mods(uint8_t mods) { + if (oneshot_locked_mods & mods) { + oneshot_locked_mods &= ~mods; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) static uint16_t oneshot_time = 0; bool has_oneshot_mods_timed_out(void) { |