Closed Granjow closed 7 years ago
I quickly tested this and I'm not yet sure what this fixes. I know the alert is a problem due to the fact that when you use an alert the browser loses focus on the page before you let go of the keys, but this doesn't seem to fix it, at least with this simple test:
$(window).jkey('alt+d', function () {
alert('test')
})
If I press alt+d
I get an alert. If I then just press alt
I get the alert still.
Yes, this cannot be handled I guess. A workaround for this could be a timeout, assuming that shortcuts are pressed within 2 seconds or so, and releasing keys after that. What the patch handles is that you can, after your test, type «doughnut» in an input field without getting a «test» alert again (for the d).
:+1:
Closing because was not merged.
Here you go. The indentation is a bit unreadable this way :D