-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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 on a OSL activated layer #20410
Conversation
quantum/action.c
Outdated
@@ -373,7 +373,8 @@ void process_action(keyrecord_t *record, action_t action) { | |||
if (is_oneshot_layer_active() && event.pressed && | |||
(action.kind.id == ACT_USAGE || !(IS_MODIFIER_KEYCODE(action.key.code) | |||
# ifndef NO_ACTION_TAPPING | |||
|| (tap_count == 0 && (action.kind.id == ACT_LMODS_TAP || action.kind.id == ACT_RMODS_TAP)) | |||
|| ((action.kind.id == ACT_LMODS_TAP || action.kind.id == ACT_RMODS_TAP) && | |||
(action.layer_tap.code <= MODS_TAP_TOGGLE || tap_count == 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tap_count == 0
accounted for mod-tap, but not for OSM. action.layer_tap.code <= MODS_TAP_TOGGLE
accounts for MODS_ONESHOT
and MODS_TAP_TOGGLE
. TBH I don't know how the latter can occur, can't figure a keycode leading to it. But considering it's for mods also I think it makes sense to consider them too.
I intended to look into adding a unit test for this, but I can't seem to build them. I'm getting "undefined reference" linker errors on many functions, seems to be the ones with weak linking. I'm on QMK MSYS, don't know if it's a setup issue. I'll try asking around on Discord. |
I didn't figure out my linker issue, but gave it a try anyway, relying on the CI tests. Unfortunately means I failed on first attempt, but second succeeded. |
Currently the tests could be built either on Linux, or on MacOS if you compile them using GCC instead of Clang (which is apparently the default compiler there). The MSYS2 toolchain for Windows has some issues with weak symbols ( |
I see, thanks for the info. I guess I should use a container/WSL if I have another need to run them. I used vagrant in the past (have not tried running tests with it though), but since support was removed I went back to MSYS, and TBH was happy about it cause the container was extremely slow. |
Thank you for your contribution! |
Thank you for your contribution! |
This reverts commit e0eb90a.
This change breaks the functionality of putting one shot mods on a layer and using them on the default (or other) layer. I raised an issue related to this: #22566 Edit: Oops not sure why my revert commit was added here. I am sure some less heavy-handed solution is possible. haha ;) |
Same here, I am relying on the old functionality, and had to revert these changes to make it work again. |
Description
This change follows #19214 by @kosorin, which allowed mod-tap hold action on one shot layers. The purpose of this change is to do the same for one shot mods and allow them on one shot layers.
I attempted adding
OSM(MOD_LSFT)
on one of myOSL
activated layers in order to use it along with accented letters I have on that layer. I realized it didn't work and after looking into the code I noticed the condition that prevents deactivating one shot layers with mods, which wasn't considering one shot mods, but was considering mod-tap. So it seemed like a simple oversight, doesn't seem intended that OSM wasn't considered. At least I can't think of a reason why it would be supported with other mods but not with OSM.Types of Changes
Issues Fixed or Closed by This PR
Checklist