Clear masked keys on release in `Runtime.handleKeyswitchEvent()`

This fixes a problem with a plugin that returns `ABORT` from its
`onKeyswitchEvent()` handler, for a masked key addr.  I'm convinced that a
better solution is to switch from using `Key_NoKey` (a.k.a. `Key_Masked`) to
using `Key_Transparent` as the default for new events, and thus, the value that
signals that a lookup should be done, but this at least fixes the bug for now,
with a much less intrusive change.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1043/head
Michael Richters 4 years ago
parent 5ddd7d1867
commit 9ac4cc5a6f
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -102,6 +102,11 @@ Runtime_::handleKeyswitchEvent(KeyEvent event) {
// When a key toggles off, set the event's key value to whatever the key's // When a key toggles off, set the event's key value to whatever the key's
// current value is in the live keys state array. // current value is in the live keys state array.
event.key = live_keys[event.addr]; event.key = live_keys[event.addr];
// If that key was masked, unmask it and return.
if (event.key == Key_Masked) {
live_keys.clear(event.addr);
return;
}
} else if (event.key == Key_NoKey) { } else if (event.key == Key_NoKey) {
// When a key toggles on, unless the event already has a key value (i.e. we // When a key toggles on, unless the event already has a key value (i.e. we
// were called by a plugin rather than `actOnMatrixScan()`), we look up the // were called by a plugin rather than `actOnMatrixScan()`), we look up the

Loading…
Cancel
Save