From: Robert Kaiser Date: Tue, 15 Aug 2017 15:01:09 +0000 (+0200) Subject: add support for PAGE_UP/DOWN keys for presentation remotes, and add some more keys... X-Git-Url: https://git-public.kairo.at/?a=commitdiff_plain;h=80b2a5a3bdf1f60c428fa737278ecd8c793527ed;p=slides.git add support for PAGE_UP/DOWN keys for presentation remotes, and add some more keys for fun --- diff --git a/fosdem2017/slides.js b/fosdem2017/slides.js index 2807799..58300e3 100644 --- a/fosdem2017/slides.js +++ b/fosdem2017/slides.js @@ -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; } }