Skip to content

Instantly share code, notes, and snippets.

@iandunn
Created September 12, 2015 03:58
Show Gist options
  • Save iandunn/325997fb7a5b79d92627 to your computer and use it in GitHub Desktop.
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
/**
* 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