Windows通用应用程序和热键

时间:2015-11-09 13:26:40

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

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

1 个答案:

答案 0 :(得分:1)

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

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

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

这是[{3}}使用的AcceleratorKeyActivated。