From 06cdd9b7cd62ffde1f8ebcc91b66ae45944718c7 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Fri, 8 Jan 2016 13:49:06 +0100 Subject: [PATCH] include speaker view keyboard shortcut when applicable #1466 --- js/reveal.js | 5 +++++ plugin/notes/notes.js | 3 +++ 2 files changed, 8 insertions(+) diff --git a/js/reveal.js b/js/reveal.js index 9302f82..c576c8c 100644 --- a/js/reveal.js +++ b/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; } }; diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 202e73b..deb4891 100644 --- a/plugin/notes/notes.js +++ b/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 };