diff options
author | Joris Guyonvarch | 2015-03-22 13:29:45 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-22 13:29:45 +0100 |
commit | 7e442c937e1d0696c2cff591a06e869f92d08595 (patch) | |
tree | 8edc523d64b06cdd31c3d19bb93fa87b18de613f /index.html | |
parent | 2abb8ffa46cbe86deedb9ddcbb9b042b51285feb (diff) |
Better support from keyboard thanks to event.which on key press
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,7 +18,8 @@ <script> var timer = Elm.fullscreen(Elm.Main, { initialTime: new Date().getTime(), - clickAway: [] + clickAway: [], + keyPress: 0 }); timer.ports.clickPosition.subscribe(function(pos) { @@ -45,6 +46,10 @@ } }); + document.onkeypress = function(event) { + timer.ports.keyPress.send(event.which); + }; + </script> </html> |