Prevent exiting fullscreen when pressing "ESC" in Flex

We have a Flex application that starts in full screen mode at startup (which is possible when working with an .exe projector). When the user presses ESC, the application exits full-screen mode. Is there any way to prevent this? This is because we want to use the ESC key for other functions.

Usually, all keyboard input is disabled in full screen mode, but not when we start it as a projector.

I have already tried to capture an event FullScreenEvent.FULL_SCREENwith no luck (this event is triggered only when the user selects "Full Screen" in Adobe Flash Player or falls into "CTRL + F".

+3
source share
3 answers

I don’t think so, and if it were, I think that IT managers should consider blocking the use of Flash. Users of the Flash plugin should always be able to complete the full screen with the Esc key. You must consider the prohibition of the Esc key.

+4
source

In Adobe Air, you can do this by calling preventDefault()at KeyboardEvent:

protected function windowedapplication_preinitializeHandler(event:FlexEvent):void
{
    nativeWindow.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
    nativeWindow.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}

protected function onKeyDown(event:KeyboardEvent):void
{
    if (event.keyCode == 27)
    {
        event.preventDefault();
    }
}
+6
source

You can do this using the Adobe AIR application, but not using the Flash Player application.

+2
source

Source: https://habr.com/ru/post/1732333/


All Articles