Use class Keyboard
. Using Keyboard.IsKeyDown
you can check if Control, Shift, Alt is down now.
For Shift:
if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift))
{ /* Your code */ }
For Control:
if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
{ /* Your code */ }
For Alt:
if (Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt))
{ /* Your code */ }
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…