Skip to content

Commit

Permalink
reenable keyboardlock in fullscreenchange event
Browse files Browse the repository at this point in the history
  • Loading branch information
sirux88 committed Jan 30, 2022
1 parent 27d0b5d commit 28b0335
Showing 1 changed file with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,20 @@ angular.module('client').factory('guacFullscreen', ['$injector',
// check is browser is in fullscreen mode (may have failed in step above)
// if so additionally set keyboard lock mode to prevent execution of special keys
// on local os (e.g. Win key, functions keys like F11(= default kex for browser fullsceen mode))
if(service.isInFullscreenMode())navigator.keyboard.lock();
else navigator.keyboard.unlock();

}
}

// attach to fullscreenevent and set keyboard lock
// this is done by event, to
// document.addEventListener('fullscreenchange', () => {
//attach to fullscreenevent and set keyboard lock
//this is done by fullscreenchange event, to prevent browser errors
// (running this immediately after setting fullscreen throws errors)
document.addEventListener('fullscreenchange', () => {

// if (navigator.keyboard){
// if(service.isInFullscreenMode()){

// }else{

// }
// }
// })
if (navigator.keyboard){
if(service.isInFullscreenMode())navigator.keyboard.lock();
else navigator.keyboard.unlock();
}
})

return service;
}
Expand Down

0 comments on commit 28b0335

Please sign in to comment.