-
-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OSM modifiers only send keydown when held after tap #24925
base: develop
Are you sure you want to change the base?
Conversation
This would need to go to That said, there have been a few changes on |
Good point, I'll try and see if it's still a problem on I'll get back to you about w.r.t. messing with action handling, I've verified the following
I have not been able to get the unit tests working (I have little C experience) and my IDE doesn't seem to recognise the macros and defined used there, so it's hard to dig into. Any pointers here would be helpful. |
f5a7c9a
to
1bd030d
Compare
@Jari27 thank you for this contribution! Here are a few pointers on unit testing. QMK uses the GoogleTest C++ unit testing framework (yes, C++, though QMK itself is C). The quickest way to get started is to look at how existing tests under the Some essential parts of GoogleTest are implemented as macros, and yes, this is confusing to IDEs (and programmers). I'm afraid the macros can't be avoided. If you are looking for definitions of the test harness (" You can build and run test "
|
Also unit tests don't work on Windows with MSYS2 due to some deficiencies in that toolchain (QMK uses weak symbols in lots of places, and apparently the gcc-mingw64 toolchain does not support weak symbols properly). You can either use Linux (including QMK WSL) or macOS to run tests, or, if you are stuck with MSYS2, try passing |
1bd030d
to
c2d4dd5
Compare
Got a bit further -- current approach is resetting oneshots when the same oneshot key is held (instead of playing around with the keyboard_record function). I am not able to write a test that exhibits the incorrect behaviour (test seems to completely ignore the held OSM and does not send any reports:
Will look a bit more tomorrow! |
6f4ef2e
to
acd18f0
Compare
Description
(seems related to #3963)
Currently, one shot modifiers have weird behavior on windows (and maybe others). After a OSM(MOD_XXX) key is tapped and then held and released, there is a key down even registered for that key but no key up. Additionally, according to QMK the mod is not considered active. So for the host, the modifier is active but for QMK it's not. This seems like a bug.
This PR fixes the problem by only sending one shot modifiers to the host if there is in fact a relevant key pressed, i.e. no one shots. This allows the user to deactivate one shots by holding and releasing past COMBO_TERM.
Replicate:
OSM(MOD_GUI)
key (or another OSM modifier)Example debug output with bug
Example debug output with this new PR
Types of Changes
Issues Fixed or Closed by This PR
Checklist