防止在使用“ESC”时退出全屏在 Flex 中按下

发布于 2024-08-21 06:38:16 字数 285 浏览 3 评论 0原文

我们有一个 Flex 应用程序,它在启动时进入全屏(当它是投影仪 .exe 时这是可能的)。当用户按 ESC 键时,应用程序退出全屏模式。有什么办法可以防止这种情况发生吗?这是因为我们想将 ESC 键用于其他功能。

通常,所有键盘输入在全屏模式下都会被禁用,但当我们将其作为投影仪运行时则不会。

我已经尝试捕获 FullScreenEvent.FULL_SCREEN 事件,但没有运气(仅当用户在 Adob​​e Flash Player 中选择“全屏”或点击“CTRL + F”时才会触发此事件。

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 application 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".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小鸟爱天空丶 2024-08-28 06:38:16

在 Adob​​e Air 中,您可以通过在 KeyboardEvent 上调用 preventDefault() 来完成此操作:

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();
    }
}

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();
    }
}
心的位置 2024-08-28 06:38:16

我不这么认为,如果有的话,我认为 IT 经理可能值得考虑阻止闪存的使用。 Flash 插件的用户应该始终能够使用 Esc 键结束全屏。您应该考虑使用 Esc 键。

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.

橘虞初梦 2024-08-28 06:38:16

您可以使用 Adob​​e AIR 应用程序执行此操作,但不能使用 Flash Player 应用程序执行此操作。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文