|
@@ -2098,40 +2098,75 @@ var Reveal = (function(){
|
|
|
|
|
|
if( hasFocus || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
|
|
if( hasFocus || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
|
|
|
|
|
|
- var triggered = true;
|
|
+
|
|
-
|
|
|
|
-
|
|
|
|
if( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) {
|
|
if( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- switch( event.keyCode ) {
|
|
+ var triggered = false;
|
|
-
|
|
+
|
|
- case 80: case 33: navigatePrev(); break;
|
|
+
|
|
-
|
|
+ if( typeof config.keyboard === 'object' ) {
|
|
- case 78: case 34: navigateNext(); break;
|
|
+
|
|
-
|
|
+ for( var key in config.keyboard ) {
|
|
- case 72: case 37: navigateLeft(); break;
|
|
+
|
|
-
|
|
+
|
|
- case 76: case 39: navigateRight(); break;
|
|
+ if( parseInt( key, 10 ) === event.keyCode ) {
|
|
-
|
|
+
|
|
- case 75: case 38: navigateUp(); break;
|
|
+ var value = config.keyboard[ key ];
|
|
-
|
|
+
|
|
- case 74: case 40: navigateDown(); break;
|
|
+
|
|
-
|
|
+ if( typeof value === 'function' ) {
|
|
- case 36: slide( 0 ); break;
|
|
+ value.apply( null, [ event ] );
|
|
-
|
|
+ }
|
|
- case 35: slide( Number.MAX_VALUE ); break;
|
|
+
|
|
-
|
|
+ else if( typeof value === 'string' && typeof Reveal[ value ] === 'function' ) {
|
|
- case 32: isOverview() ? deactivateOverview() : event.shiftKey ? navigatePrev() : navigateNext(); break;
|
|
+ Reveal[ value ].call();
|
|
-
|
|
+ }
|
|
- case 13: isOverview() ? deactivateOverview() : triggered = false; break;
|
|
+
|
|
-
|
|
+ triggered = true;
|
|
- case 66: case 190: case 191: togglePause(); break;
|
|
+
|
|
-
|
|
+ }
|
|
- case 70: enterFullscreen(); break;
|
|
+
|
|
- default:
|
|
+ }
|
|
- triggered = false;
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if( triggered === false ) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ triggered = true;
|
|
|
|
+
|
|
|
|
+ switch( event.keyCode ) {
|
|
|
|
+
|
|
|
|
+ case 80: case 33: navigatePrev(); break;
|
|
|
|
+
|
|
|
|
+ case 78: case 34: navigateNext(); break;
|
|
|
|
+
|
|
|
|
+ case 72: case 37: navigateLeft(); break;
|
|
|
|
+
|
|
|
|
+ case 76: case 39: navigateRight(); break;
|
|
|
|
+
|
|
|
|
+ case 75: case 38: navigateUp(); break;
|
|
|
|
+
|
|
|
|
+ case 74: case 40: navigateDown(); break;
|
|
|
|
+
|
|
|
|
+ case 36: slide( 0 ); break;
|
|
|
|
+
|
|
|
|
+ case 35: slide( Number.MAX_VALUE ); break;
|
|
|
|
+
|
|
|
|
+ case 32: isOverview() ? deactivateOverview() : event.shiftKey ? navigatePrev() : navigateNext(); break;
|
|
|
|
+
|
|
|
|
+ case 13: isOverview() ? deactivateOverview() : triggered = false; break;
|
|
|
|
+
|
|
|
|
+ case 66: case 190: case 191: togglePause(); break;
|
|
|
|
+
|
|
|
|
+ case 70: enterFullscreen(); break;
|
|
|
|
+ default:
|
|
|
|
+ triggered = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|