diff options
Diffstat (limited to 'public/assets/js/index.js')
| -rw-r--r-- | public/assets/js/index.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/public/assets/js/index.js b/public/assets/js/index.js index 8f1a059..2e5ac92 100644 --- a/public/assets/js/index.js +++ b/public/assets/js/index.js @@ -7,6 +7,7 @@ var app = (function(){ $(window).on("focus", app.focus) $(window).on("blur", app.blur) + $(window).on("keydown", app.keydown) } app.focused = true @@ -20,6 +21,23 @@ var app = (function(){ app.focused = false } + app.keydown = function(e){ + switch (e.keyCode) { + case 37: // left + // prev + break + case 39: // right + // next + break + case 38: // up + // home + break + case 40: // down + // random + break + } + } + document.addEventListener('DOMContentLoaded', app.init) return app |
