开发者

Prevent exit fullscreen when "ESC" is pressed in Flex

We have a Flex application which goes fullscreen on startup (which is possible when it's a projector .exe). When a user presses ESC, the appl开发者_运维百科ication exits fullscreen mode. Is there any way to prevent this? This because we want to use the ESC-key for other functionality.

Normally all keyboard input is disabled in fullscreen mode, but not when we run it as a projector.

I already tried capturing the FullScreenEvent.FULL_SCREEN event without luck (this event is only fired when the user selects "Full Screen" in the Adobe Flash Player or hits "CTRL + F".


In Adobe Air, you can do it by calling preventDefault() on the 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();
    }
}


I don't think so and if there were is I think it may be worth IT managers considering blocking Flash usage. Users of the Flash plugin should always be able to end full screen with the Esc key. You should consider the Esc key off-limits.


You can do this with an Adobe AIR application but not with a Flash Player application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜