javascript - Capture Escape key in fullscreened iframe -
in web app, capturing escape key exit out of internal state. have support app embedded in iframe controls make app full-screen fullscreen api (requestfullscreen). unfortunately, in chrome, browser uses escape key exit out of fullscreen mode. interferes escape key handler.
my first attempt try call preventdefault() on event. however, after investigation, appears not getting keydown event @ all. other keydown events.
are there workarounds capture event , prevent browser exiting fullscreen mode?
edit:
here have now:
$(document).keydown(function(e) { if( e.keycode == 27) { alert('escape pressed'); //do stuff e.preventdefault(); } }); the alert never shown.
Comments
Post a Comment