Skip to content

Commit

Permalink
feat(*): cancel all keyboard events
Browse files Browse the repository at this point in the history
  • Loading branch information
niklashigi committed Dec 29, 2017
1 parent 6344527 commit 0ebc055
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/inputs/keyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ export class Keyboard {
const key = event.key.toLowerCase()
this.pressedKeys.add(key)
this.queuedKeys.add(key)
return false
})

this.document.addEventListener('keyup', (event: any) => {
store.preferGamepad = false
const key = event.key.toLowerCase()
this.pressedKeys.delete(key)
this.queuedKeys.delete(key)
return false
})
}

Expand Down

0 comments on commit 0ebc055

Please sign in to comment.