merge #959 with minor tweaks
This commit is contained in:
commit
db359519ae
11
js/reveal.js
11
js/reveal.js
@ -3764,8 +3764,15 @@
|
|||||||
// keyboard modifier key is present
|
// keyboard modifier key is present
|
||||||
if( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
|
if( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
|
||||||
|
|
||||||
// While paused only allow "unpausing" keyboard events (b and .)
|
// While paused only allow resume keyboard events;
|
||||||
if( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) {
|
// 'b', '.' or any key specifically mapped to togglePause
|
||||||
|
var resumeKeyCodes = [66,190,191].concat( Object.keys( config.keyboard ).map( function( key ) {
|
||||||
|
if( config.keyboard[key] === 'togglePause' ) {
|
||||||
|
return parseInt( key, 10 );
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
if( isPaused() && resumeKeyCodes.indexOf( event.keyCode ) === -1 ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user