You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OSL didn't work on some of the keycode avaiable but works for custom keycode.
Describe the Bug
I use Fn as a Oneshot layer key with some media keys like KC_MPLY, KC_VOLU and some other keycode like KC_CALC and KC_LOCK on that layer. I also put a custom keycode C(S(KC_ESC)) for test purpose.
If I tap Fn, the one shot layer was activated(LED indicator for that layer lights up) but KC_MPLY or KC_CALC won't work, while my custom keycode C(S(ESC)) and KC_LOCK works fine. KC_VOLU worked once but acted as stuck to turn my volume all the way down to mute.
If I hold Fn, everything just works fine. And switch to that layer everything works fine, too.
The issue was found originally when I use a tap dance on my Fn to activate the one shot layer, after that I tried OSL(1) but it doesn't work either.
System Information
Keyboard: GMMK Pro ANSI(STM32)
Operating system: Windows 10
AVR GCC version: 8.4.0
ARM GCC version: 10.1.0
QMK Firmware version: 0.13.23
tested on both master and dev branch
Any keyboard related software installed?
AutoHotKey
Karabiner
Other:
Additional Context
The text was updated successfully, but these errors were encountered:
The code which handles turning the one shot layer off fakes a key release event immediately after processing the key press event. Because those events are separate, the release event bypasses TAP_CODE_DELAY (which is the usual solution for the media keys not registering properly), and therefore can trigger the problem 2 below.
/* Because we switch layers after a oneshot event, we need to release the
* key before we leave the layer or no key up event will be generated.
*/
if (do_release_oneshot&& !(get_oneshot_layer_state() &ONESHOT_PRESSED)) {
record->event.pressed= false;
layer_on(get_oneshot_layer());
process_record(record);
layer_off(get_oneshot_layer());
}
#endif
I'm not sure whether that piece of code is really needed (or maybe it should be inside #ifdef STRICT_LAYER_RELEASE) — usually the source layer cache ensures that the key release event would be handled using the same keycode that was used for the matching key press event, and therefore just turning off the one shot layer should be enough.
The ChibiOS implementation of the code which actually sends the events for media keys to the host may misbehave if it is invoked before the previous event has been read by the host. PR [Bugfix] Check USB transmit status in ChibiOS send_extra() #14643 attempts to fix that, but it is still not decided which way to fix the problem would be the most correct one.
@sigprof Thanks for the heads up. Actually @daskygit discussed his issue with me earlier in discord server, though the symptoms are different but it seems they are quite related. I will keep an eye on that pull request.
OSL didn't work on some of the keycode avaiable but works for custom keycode.
Describe the Bug
I use Fn as a Oneshot layer key with some media keys like
KC_MPLY
,KC_VOLU
and some other keycode likeKC_CALC
andKC_LOCK
on that layer. I also put a custom keycodeC(S(KC_ESC))
for test purpose.If I tap Fn, the one shot layer was activated(LED indicator for that layer lights up) but
KC_MPLY
orKC_CALC
won't work, while my custom keycodeC(S(ESC))
andKC_LOCK
works fine.KC_VOLU
worked once but acted as stuck to turn my volume all the way down to mute.If I hold Fn, everything just works fine. And switch to that layer everything works fine, too.
The issue was found originally when I use a tap dance on my Fn to activate the one shot layer, after that I tried OSL(1) but it doesn't work either.
System Information
Keyboard: GMMK Pro ANSI(STM32)
Operating system: Windows 10
AVR GCC version: 8.4.0
tested on both master and dev branch
Additional Context
The text was updated successfully, but these errors were encountered: