ten1seven / what-input

A global utility for tracking the current input method (mouse/pointer, keyboard or touch).
https://ten1seven.github.io/what-input
MIT License
1.36k stars 77 forks source link

Changed unLogKeys event to use document #12

Closed joshsalverda closed 8 years ago

joshsalverda commented 8 years ago

If keyup is also bound to document.body, the whatInput.keys() array is already empty by the time it is read. This is due to the fact that unLogKeys gets called before the second bound event is executed. Changed unLogKeys to bind to document instead which should avoid this issue entirely.

ten1seven commented 8 years ago

:+1: Nice solution! Thanks!