Getting shift/ctrl/alt states from a mouse event?

后端 未结 2 1038
一个人的身影
一个人的身影 2021-01-11 09:11

In my WPF App, how do I get the state of the shift, ctrl and alt keys in my mouse event handler? I seem to remember in MF

2条回答
  •  迷失自我
    2021-01-11 10:02

    Assuming that you're still in the mouse event handler, you can check the value of Keyboard.Modifiers. I don't think that there is anyway to get modifier information from the event itself, so you have to interrogate the keyboard directly.

提交回复
热议问题