Skip to content
Snippets Groups Projects
Unverified Commit edc9c0a8 authored by Hakim El Hattab's avatar Hakim El Hattab Committed by GitHub
Browse files

Merge pull request #1958 from ThomasWeinert/feature/block_f5_in_notes

Block F5 in speaker notes window, avoid disconnects
parents 09471a05 c0109d94
Branches
Tags
No related merge requests found
...@@ -427,10 +427,16 @@ ...@@ -427,10 +427,16 @@
* Forward keyboard events to the current slide window. * Forward keyboard events to the current slide window.
* This enables keyboard events to work even if focus * This enables keyboard events to work even if focus
* isn't set on the current slide iframe. * isn't set on the current slide iframe.
*
* Block F5 default handling, it reloads and disconnects
* the speaker notes window.
*/ */
function setupKeyboard() { function setupKeyboard() {
document.addEventListener( 'keydown', function( event ) { document.addEventListener( 'keydown', function( event ) {
if (event.keyCode === 116) {
event.preventDefault();
}
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' ); currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' );
} ); } );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment