aboutsummaryrefslogtreecommitdiffhomepage
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab2012-07-20 22:20:07 -0400
committerHakim El Hattab2012-07-20 22:20:33 -0400
commit0ef90e0dcf289e81414faecc8122825532d1689d (patch)
tree2eeebacf895f97e88d97b822d39810024aa6322a /js
parent7f9662edab1c7d25c3a74506e365684e0befb7c3 (diff)
'keyboard' config option for disabling keyboard navigation (closes #84)
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js
index e0be839..7811218 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -27,6 +27,9 @@ var Reveal = (function(){
// Push each slide change to the browser history
history: false,
+ // Enable keyboard shortcuts for navigation
+ keyboard: true,
+
// Loop the presentation
loop: false,
@@ -179,12 +182,15 @@ var Reveal = (function(){
}
function addEventListeners() {
- document.addEventListener( 'keydown', onDocumentKeyDown, false );
document.addEventListener( 'touchstart', onDocumentTouchStart, false );
document.addEventListener( 'touchmove', onDocumentTouchMove, false );
document.addEventListener( 'touchend', onDocumentTouchEnd, false );
window.addEventListener( 'hashchange', onWindowHashChange, false );
+ if( config.keyboard ) {
+ document.addEventListener( 'keydown', onDocumentKeyDown, false );
+ }
+
if ( config.controls && dom.controls ) {
dom.controlsLeft.addEventListener( 'click', preventAndForward( navigateLeft ), false );
dom.controlsRight.addEventListener( 'click', preventAndForward( navigateRight ), false );