I'm using Fullscreen API in Chrome and FF providing a button for the user to switch with code like this:
function initFullscreen() {
$('#fullscreen').on('click', function(e) {
requestFullscreen();
$('#fullscreen').fadeOut();
});
$(document).keyup(function(e) {
// esc
if (e.keyCode == 27) {
$('#fullscreen').fadeIn();
}
});
}
When in fullscreen mode the button disappears, but clicking ESC brings the button back only if I click ESC a second time when already in normal mode again.
Anyone with an idea why keyup handler is not triggered in fullscreen mode?