Detecting the user pressing F10 in WPF

前端 未结 4 1685
迷失自我
迷失自我 2021-01-03 22:40

My WPF application has behaviour triggered by the functions keys (F1-F12).

My code is along these lines:

private void Window_Ke         


        
4条回答
  •  甜味超标
    2021-01-03 23:27

    In addition to Yacoder's response, use the following to check for the F10 key:

    case Key.System:
      if (e.SystemKey == Key.F10)
      {
        // logic...
      }
    

    The SystemKey property will tell you which System key was pressed.

提交回复
热议问题