[Core] Fix flipped logic bug with One Shot OS_ON
/ OS_OFF
keys
#16617
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The One Shot documentation says key
OS_ON
turns one-shot keys on andOS_OFF
turns them off. The actual behavior is flipped:OS_ON
turns them off andOS_OFF
turns them on. This PR fixes this.Description
This bug was discovered by reddit user u/Dutchnesss1. I can reproduce it on my keyboards. We were troubleshooting a problem where one-shot keys weren't work on Dutchnesss1's keyboard, and confusingly,
OS_ON
disabled one-shot keys when we thought we were enabling them.The underlying problem is the logic for functions
oneshot_set()
,oneshot_enable()
,oneshot_disabled()
, andis_oneshot_enabled()
are similarly flipped. The bug is rather obvious once looking at their implementation (code link):Calling
oneshot_enable()
callsoneshot_set(true)
, which setskeymap_config.oneshot_disable = true
.Types of Changes
Checklist