Sfoglia il codice sorgente

include speaker view keyboard shortcut when applicable #1466

Hakim El Hattab 9 anni fa
parent
commit
06cdd9b7cd
2 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 5 0
      js/reveal.js
  2. 3 0
      plugin/notes/notes.js

+ 5 - 0
js/reveal.js

@@ -4684,6 +4684,11 @@
 		// Programatically triggers a keyboard event
 		triggerKey: function( keyCode ) {
 			onDocumentKeyDown( { keyCode: keyCode } );
+		},
+
+		// Registers a new shortcut to include in the help overlay
+		registerKeyboardShortcut: function( key, value ) {
+			keyboardShortcuts[key] = value;
 		}
 	};
 

+ 3 - 0
plugin/notes/notes.js

@@ -120,6 +120,9 @@ var RevealNotes = (function() {
 			}
 		}, false );
 
+		// Show our keyboard shortcut in the reveal.js help overlay
+		if( window.Reveal ) Reveal.registerKeyboardShortcut( 'S', 'Speaker notes view' );
+
 	}
 
 	return { open: openNotes };