merge #959 with minor tweaks

edit
Hakim El Hattab 2015-06-03 11:59:00 +02:00
commit db359519ae
1 changed files with 9 additions and 2 deletions

View File

@ -3764,8 +3764,15 @@
// keyboard modifier key is present
if( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
// While paused only allow "unpausing" keyboard events (b and .)
if( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) {
// While paused only allow resume keyboard events;
// '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;
}