diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-06 22:32:55 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-06 22:32:55 -0500 |
commit | 11a84a636ce9722053cc3100d5c04e30e9f93df2 (patch) | |
tree | 7d130f25e5b2cd6c6c7eb75ebcd00e9711a621a0 | |
parent | 6b25b9bc9deaafc093397e436ef8360f79754af7 (diff) | |
parent | 8a0e08a1e5b27a7c0ee7afe9564f80c3fa5f04b1 (diff) |
Merge pull request #2100 from dreamlayers/prevent_hotkeys
Always preventDefault() on keydown if keypress is not needed.
-rw-r--r-- | src/library_sdl.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 04e8fc18..caba9b74 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -406,7 +406,7 @@ var LibrarySDL = { // won't fire. However, it's fine (and in some cases necessary) to // preventDefault for keys that don't generate a character. Otherwise, // preventDefault is the right thing to do in general. - if (event.type !== 'keydown' || (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */)) { + if (event.type !== 'keydown' || (!SDL.unicode && !SDL.textInput) || (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */)) { event.preventDefault(); } |