From 532ae8f1f506dd07f669f1c2d8525366c46bf3bb Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Wed, 13 Feb 2019 12:38:42 -0600 Subject: [PATCH] Fixed OneShot with new live_composite_keymap_ With the changes to live_composite_keymap_, OneShot keys were no longer working. OneShot modifiers would get stuck on, because the entry for the `OSM` key would get changed to the modifier key value, and when the key was released, it wouldn't be processed by the OneShot plugin, which would continue to re-apply the modifier indefinitely. At the same time, OneShot layers wouldn't work at all, because the key would get changed to the layer shift key, which would then turn the layer off when it was released. This change fixes the problem by injecting keyswitch events from OneShot without physical key coordinates, so nothing in `live_composite_keymap_` can get updated from it. OneShot wants the `Key` entries there to remain as OneShot keys, not as whatever they're changed to, so this is the most appropriate way I can think of to fix the issue. Signed-off-by: Michael Richters --- src/kaleidoscope/plugin/OneShot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kaleidoscope/plugin/OneShot.cpp b/src/kaleidoscope/plugin/OneShot.cpp index 26a7d788..51513761 100644 --- a/src/kaleidoscope/plugin/OneShot.cpp +++ b/src/kaleidoscope/plugin/OneShot.cpp @@ -70,7 +70,7 @@ void OneShot::injectNormalKey(uint8_t idx, uint8_t key_state) { } positionToCoords(state_[idx].position, &row, &col); - handleKeyswitchEvent(key, row, col, key_state | INJECTED); + handleKeyswitchEvent(key, UNKNOWN_KEYSWITCH_LOCATION, key_state | INJECTED); } void OneShot::activateOneShot(uint8_t idx) {