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 <gedankenexperimenter@gmail.com>
pull/502/head
Michael Richters 6 years ago
parent 26ff408719
commit 532ae8f1f5

@ -70,7 +70,7 @@ void OneShot::injectNormalKey(uint8_t idx, uint8_t key_state) {
} }
positionToCoords(state_[idx].position, &row, &col); 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) { void OneShot::activateOneShot(uint8_t idx) {

Loading…
Cancel
Save