How to detect modifier key states in WPF?

前端 未结 6 1538
粉色の甜心
粉色の甜心 2020-12-04 15:10

Is there some global constructs that I can use whenever I need to access whether the Control, Shift, Alt buttons are down? For instance inside MouseDown event o

6条回答
  •  温柔的废话
    2020-12-04 15:23

    There's also:

    // Have to get this value before opening a dialog, or user will have released the control key
    if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
    {
    
    }
    

提交回复
热议问题