diff options
author | Guillaume Blanc <guillaumeblanc.sc@gmail.com> | 2014-04-22 13:40:22 +0200 |
---|---|---|
committer | Guillaume Blanc <guillaumeblanc.sc@gmail.com> | 2014-04-22 13:40:22 +0200 |
commit | fd9e8330eafcdb9112753ed6729954605f357280 (patch) | |
tree | 180686f91f0e82f43048aedebe71c5cb83a19e0c /src | |
parent | 153e0f6426ff908166abdf07be7f91601fbed07f (diff) |
Fixes glfwGetKey that always returns 0 if no callback is set with glfwSetKeyCallback; fixes #1320
Diffstat (limited to 'src')
-rw-r--r-- | src/library_glfw.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library_glfw.js b/src/library_glfw.js index f72aeb24..0b3fccd4 100644 --- a/src/library_glfw.js +++ b/src/library_glfw.js @@ -130,9 +130,11 @@ var LibraryGLFW = { onKeyChanged: function(event, status) { var key = GLFW.DOMToGLFWKeyCode(event.keyCode); - if (key && GLFW.keyFunc) { + if (key) { GLFW.keys[key] = status; - Runtime.dynCall('vii', GLFW.keyFunc, [key, status]); + if (GLFW.keyFunc) { + Runtime.dynCall('vii', GLFW.keyFunc, [key, status]); + } } }, |