Improve one shot hold
This commit is contained in:
parent
c6e976889f
commit
428530799b
1 changed files with 6 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "oneshot.h"
|
||||
|
||||
// https://github.com/daliusd/qmk_firmware/blob/daliusd-redox/keyboards/ferris/keymaps/daliusd/oneshot.c
|
||||
|
||||
void update_oneshot(
|
||||
oneshot_state *state,
|
||||
uint16_t mod,
|
||||
|
@ -39,7 +41,11 @@ void update_oneshot(
|
|||
}
|
||||
if (!is_oneshot_ignored_key(keycode)) {
|
||||
switch (*state) {
|
||||
case os_down_unused:
|
||||
*state = os_down_used;
|
||||
break;
|
||||
case os_up_used:
|
||||
*state = os_up_unqueued;
|
||||
unregister_code(mod);
|
||||
break;
|
||||
case os_up_queued:
|
||||
|
@ -53,9 +59,6 @@ void update_oneshot(
|
|||
if (!is_oneshot_ignored_key(keycode)) {
|
||||
// On non-ignored keyup, consider the oneshot used.
|
||||
switch (*state) {
|
||||
case os_down_unused:
|
||||
*state = os_down_used;
|
||||
break;
|
||||
case os_up_used:
|
||||
*state = os_up_unqueued;
|
||||
unregister_code(mod);
|
||||
|
|
Loading…
Reference in a new issue