core: release events should never trigger bindings

This commit is contained in:
Mitchell Hashimoto
2024-08-19 12:03:42 -07:00
parent 203e33c416
commit 08ba00246b

View File

@ -1473,12 +1473,14 @@ fn maybeHandleBinding(
switch (event.action) { switch (event.action) {
// Release events never trigger a binding but we need to check if // Release events never trigger a binding but we need to check if
// we consumed the press event so we don't encode the release. // we consumed the press event so we don't encode the release.
.release => if (self.keyboard.last_trigger) |last| { .release => {
if (last == event.bindingHash()) { if (self.keyboard.last_trigger) |last| {
// We don't reset the last trigger on release because if (last == event.bindingHash()) {
// an apprt may send multiple release events for a single // We don't reset the last trigger on release because
// press event. // an apprt may send multiple release events for a single
return .consumed; // press event.
return .consumed;
}
} }
return null; return null;