mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
[broadway] Cancel key events after seeing them
This commit is contained in:
parent
afdde925b8
commit
85c1c22d04
@ -1098,21 +1098,23 @@ var lastKeyDown = 0;
|
||||
function onKeyDown (ev) {
|
||||
updateForEvent(ev);
|
||||
if (localGrab)
|
||||
return;
|
||||
return cancelEvent(ev);
|
||||
var keyCode = ev.keyCode;
|
||||
if (keyCode != lastKeyDown) {
|
||||
sendInput ("k", [keyCode]);
|
||||
lastKeyDown = keyCode;
|
||||
}
|
||||
return cancelEvent(ev);
|
||||
}
|
||||
|
||||
function onKeyUp (ev) {
|
||||
updateForEvent(ev);
|
||||
if (localGrab)
|
||||
return;
|
||||
return cancelEvent(ev);
|
||||
var keyCode = ev.keyCode;
|
||||
sendInput ("K", [keyCode]);
|
||||
lastKeyDown = 0;
|
||||
return cancelEvent(ev);
|
||||
}
|
||||
|
||||
function cancelEvent(ev)
|
||||
|
Loading…
Reference in New Issue
Block a user