如何在WinRT应用程序中检测全局页面级别上的ALT(菜单)按钮快捷键 [英] How to detect ALT (Menu) button keydown on global page level in a WinRT app

查看:152
本文介绍了如何在WinRT应用程序中检测全局页面级别上的ALT(菜单)按钮快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码来检测WinRT应用程序页面中的所有关键事件:

I use following code to detect all key events in a WinRT app page:

Window.Current.CoreWindow.KeyDown += CoreWindow_KeyDown;
...

private void CoreWindow_KeyDown(CoreWindow sender, KeyEventArgs args)
{
  //Handle key event
}

但是Alt(VirtualKey枚举中的菜单)键不会触发CoreWindow.KeyDown事件.按下时,它还会阻止其他任何键来触发事件.

But the Alt (Menu in the VirtualKey enumeration) key does not trigger the CoreWindow.KeyDown event. It does also block any other key to trigger the event while pressed.

任何人都知道如何在WinRT应用程序中的全局页面级别检测到Alt键按下事件吗?

Anyone know how to detect the Alt keydown event on a global page level in a WinRT app?

推荐答案

尽管我尝试过Dispatcher.AcceleratorKeyActivated,但它可以处理Alt键.

Though I tried Dispatcher.AcceleratorKeyActivated, it handles Alt key.

这篇关于如何在WinRT应用程序中检测全局页面级别上的ALT(菜单)按钮快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆