C#: Getting the correct keys pressed from KeyEventArgs' KeyData

后端 未结 3 533
闹比i
闹比i 2021-02-04 21:01

I am trapping a KeyDown event and I need to be able to check whether the current keys pressed down are : Ctrl + Shift + M ?

<
3条回答
  •  无人共我
    2021-02-04 21:50

    You can check using a technique similar to the following:

    if(Control.ModifierKeys == Keys.Control && Control.ModifierKeys == Keys.Shift)
    

    This in combination with the normal key checks will give you the answer you seek.

提交回复
热议问题