【问题标题】:Windows universal app and hot keysWindows 通用应用程序和热键
【发布时间】:2016-02-10 03:50:29
【问题描述】:

我创建 Windows 通用应用程序。我想为 AppBarButton 添加快捷方式。可能吗?我在网络上没有找到任何关于它的信息。

【问题讨论】:

  • 请澄清一下:据我了解,您想将AppBarButtons 添加到您的AppBar,对吗?

标签: c# windows-10 win-universal-app hotkeys


【解决方案1】:

我解决了这个问题。这个article 和这个article 帮助我。如果没有控制输入可以使用这个代码:

// Listen to the window directly so focus isn't required
Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
       CoreDispatcher_AcceleratorKeyActivated;

Window.Current.CoreWindow.PointerPressed += this.CoreWindow_PointerPressed;

这是 example 使用的 AcceleratorKeyActivated 。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-28
    • 2015-03-03
    • 2018-01-25
    • 1970-01-01
    • 2021-04-04
    • 2015-11-13
    • 2020-11-02
    • 1970-01-01
    相关资源
    最近更新 更多