internal static bool IsExtendedKey( Key key )
{
// From the SDK:
// The extended-key flag indicates whether the keystroke message originated from one of
// the additional keys on the enhanced keyboard. The extended keys consist of the ALT and
// CTRL keys on the right-hand side of the keyboard; the INS, DEL, HOME, END, PAGE UP,
// PAGE DOWN, and arrow keys in the clusters to the left of the numeric keypad; the NUM LOCK
// key; the BREAK (CTRL+PAUSE) key; the PRINT SCRN key; and the divide (/) and ENTER keys in
// the numeric keypad. The extended-key flag is set if the key is an extended key.
//
// - docs appear to be incorrect. Use of Spy++ indicates that break is not an extended key.
// Also, menu key and windows keys also appear to be extended.
return key == Key.RightAlt
|| key == Key.RightCtrl
|| key == Key.NumLock
|| key == Key.Insert
|| key == Key.Delete
|| key == Key.Home
|| key == Key.End
|| key == Key.Prior
|| key == Key.Next
|| key == Key.Up
|| key == Key.Down
|| key == Key.Left
|| key == Key.Right
|| key == Key.Apps
|| key == Key.RWin
|| key == Key.LWin;
// Note that there are no distinct values for the following keys:
// numpad divide
// numpad enter
}