Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用c#windows 8.1应用程序检测指针滚轮更改时按下的键_C#_Xaml_Windows Store Apps_Winrt Xaml - Fatal编程技术网

如何使用c#windows 8.1应用程序检测指针滚轮更改时按下的键

如何使用c#windows 8.1应用程序检测指针滚轮更改时按下的键,c#,xaml,windows-store-apps,winrt-xaml,C#,Xaml,Windows Store Apps,Winrt Xaml,我想检测当指针轮更改事件为火灾时按下的键。我使用此功能检测键 private void MyKeyDown(object sender, KeyRoutedEventArgs e) { int keyValue = (int)e.Key; if ((keyValue >= 0x30 && keyValue <= 0x39) // numbers || (keyValue >= 0x41 && keyValue <

我想检测当指针轮更改事件为火灾时按下的键。我使用此功能检测键

  private void MyKeyDown(object sender, KeyRoutedEventArgs e)
{
    int keyValue = (int)e.Key;
    if ((keyValue >= 0x30 && keyValue <= 0x39) // numbers
     || (keyValue >= 0x41 && keyValue <= 0x5A) // letters
     || (keyValue >= 0x60 && keyValue <= 0x69)) // numpad
    {
        // do something
    }
}
private void MyKeyDown(对象发送方,KeyRoutedEventArgs e)
{
int-keyValue=(int)e.Key;

如果((keyValue>=0x30&&keyValue=0x41&&keyValue=0x60&&keyValue您可以存储关于哪个键发生了向下事件而不是向上事件的信息。为了简单起见,您可能还可以使用
Window.Current.CoreWindow.GetKeyState()
getasynchkeystate()