Open lokhmakov opened 8 years ago
After pressing only Enter
and HI.pause() - HumanInput thinks that I hold Enter
What browser/version are you using?
Chrome 52.0.2743.116 (64-bit)
I just commandeered my wife's Mac and can confirm this behavior. It appears to be a bug in Mac OS X itself since it is exhibited in Chrome, Firefox, and Safari. Essentially, the browser does not fire the keyup
event if the command key is held at the same time. The only keyup
event you'll get is for the command key itself.
I'll see if I can implement a workaround that resets the state of all keys held during a command+keyup
event in these situations. So something like HI.on('command-c', doStuff)
would work but if you also had a keyup:c
event at the same time it would never get triggered if the command key was held during a combo.
Interestingly, this bug doesn't appear to effect the other modifier keys. So command-shift
would work without issue.
Ok
I just pushed a commit that should fix this issue. Can you pull the latest code and confirm/deny?
Yep, 1.1.13 fix this
But
After pressing only Enter and HI.pause() - HumanInput thinks that I hold Enter
Is still here
OK I've finally got around to trying to test this on a Mac and I cannot reproduce it. Is this still happening? Here's what I've been using to test:
function onLeft() {
console.log('LEFT')
}
function onEnter() {
HI.pause();
console.log('ENTER PAUSE');
}
HI.off('left'); HI.off('enter');
HI.on('left', onLeft);
HI.on('enter', onEnter);
Then I check HI.state to see if there's anything in the down
or downAlt
arrays but every time I test it they're both empty (as they should be). It doesn't think that the enter key is still held down.
I tested in Chrome and Safari on a Mac (no idea what version it was--only had it for a few minutes). What browser were you using?
command + c
HumanInput thinks that I holdc
c
holded