Ignore spurious kinds of keydown events

This commit is contained in:
Eevee (Evelyn Woods) 2021-01-05 22:07:04 -07:00
parent b5b7ccbc46
commit 999467bb1f

View File

@ -467,6 +467,9 @@ class Player extends PrimaryView {
key_target.addEventListener('keydown', ev => { key_target.addEventListener('keydown', ev => {
if (! this.active) if (! this.active)
return; return;
// Ignore IME composition and repeat events
if (ev.isComposing || ev.keyCode === 229 || ev.repeat)
return;
this.using_touch = false; this.using_touch = false;
if (ev.key === 'p' || ev.key === 'Pause') { if (ev.key === 'p' || ev.key === 'Pause') {