add support for PAGE_UP/DOWN keys for presentation remotes, and add some more keys...
authorRobert Kaiser <kairo@kairo.at>
Tue, 15 Aug 2017 15:01:09 +0000 (17:01 +0200)
committerRobert Kaiser <kairo@kairo.at>
Tue, 15 Aug 2017 15:01:09 +0000 (17:01 +0200)
fosdem2017/slides.js

index 2807799..58300e3 100644 (file)
@@ -189,10 +189,19 @@ setTimeout("timerFired()", timerMSec);
   function handleKeyPress(e) {
     e = e || event;
     switch (e.keyCode) {
+      // See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#Constants_for_keyCode_value
       case e.DOM_VK_LEFT:
+      case e.DOM_VK_DOWN:
+      case e.DOM_VK_PAGE_DOWN:
         go("prev"); break;
       case e.DOM_VK_RIGHT:
+      case e.DOM_VK_UP:
+      case e.DOM_VK_PAGE_UP:
         go("next"); break;
+      case e.DOM_VK_HOME:
+        go("start"); break;
+      case e.DOM_VK_END:
+        go("toc"); break;
     }
   }