Skip to content

Commit

Permalink
Adds event buffering to keyup/keydown to prevent mouse move bug in Ch…
Browse files Browse the repository at this point in the history
  • Loading branch information
ten1seven committed Jun 21, 2016
1 parent 9a41bdc commit d5a0995
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions what-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ window.whatInput = (function() {
*/

// allows events that are also triggered to be filtered out for `touchstart`
function eventBuffer() {
function eventBuffer(event) {
clearTimer();
setInput(event);

Expand Down Expand Up @@ -212,8 +212,8 @@ window.whatInput = (function() {
body.addEventListener(mouseWheel, bufferedEvent);

// keyboard events
body.addEventListener('keydown', unBufferedEvent);
body.addEventListener('keyup', unBufferedEvent);
body.addEventListener('keydown', eventBuffer);
body.addEventListener('keyup', eventBuffer);
document.addEventListener('keyup', unLogKeys);
}

Expand Down
2 changes: 1 addition & 1 deletion what-input.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d5a0995

Please sign in to comment.