Created
September 12, 2015 03:58
-
-
Save iandunn/325997fb7a5b79d92627 to your computer and use it in GitHub Desktop.
Make Reveal.js compatible with clickers that only have up/down buttons. See https://github.com/hakimel/reveal.js/issues/288
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Treat up/down as page-up, page-down, so that clicker will step through each slide instead of only up/down slides | |
*/ | |
document.addEventListener( 'keydown', function( event ) { | |
switch ( event.keyCode ) { | |
// k, up | |
case 75: | |
case 38: | |
Reveal.navigatePrev(); | |
break; | |
// j, down | |
case 74: | |
case 40: | |
Reveal.navigateNext(); | |
break; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment