Tell me more ×  I have a WPF window that I allow the user to
move around by pressing the arrow keys. I've done this by
hooking into the KeyDown event:  <Window ...
KeyDown="Window_OnKeyDown">  One press of an arrow key will move
the window 1 pixel. Obviously, this is pretty slow, so I also
allow the user to hold the shift key to move the window around
faster, 5 pixels at a time:  private void
Window_OnKeyDown(object sender, KeyEventArgs e)     var key =
e.Key;     var pixelAmount = e.KeyboardDevice.Modifiers ==
ModifierKeys.Shift ? 5 : 1;      switch (key)         case
Key.Up:             Top = Top - pixelAmount;         case
Key.Down:             Top = Top + pixelAmount;         case
Key.Left:             Left = Left - pixelAmount;         case
Key.Right:             Left = Left + pixelAmount;  This code
works great if the user presses Shift followed by an arrow key.
Problem is, this doesn't work if the user is holding down an
arrow key first, then presses Shift to speed up the movement.
This is because the