aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-22 13:29:45 +0100
committerJoris Guyonvarch2015-03-22 13:29:45 +0100
commit7e442c937e1d0696c2cff591a06e869f92d08595 (patch)
tree8edc523d64b06cdd31c3d19bb93fa87b18de613f /index.html
parent2abb8ffa46cbe86deedb9ddcbb9b042b51285feb (diff)
Better support from keyboard thanks to event.which on key press
Diffstat (limited to 'index.html')
-rw-r--r--index.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/index.html b/index.html
index 7e3b489..795bf0b 100644
--- a/index.html
+++ b/index.html
@@ -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>