/// <summary> /// Simulates pressing a key /// </summary> /// <param name="hWindow"></param> /// <param name="key"></param> public static void PressKey(IntPtr hWindow, System.Windows.Input.Key key) { Win32.PostMessage(hWindow, Win32.WM_KEYDOWN, (IntPtr)System.Windows.Input.KeyInterop.VirtualKeyFromKey(key), IntPtr.Zero); //Win32.PostMessage(hWindow, Win32.WM_KEYUP, // (IntPtr)System.Windows.Input.KeyInterop.VirtualKeyFromKey(key), // IntPtr.Zero); }
private Boolean isHandledKey(System.Windows.Input.Key key) { return(key == Key.Delete || key == Key.Space || (key >= Key.A && key <= Key.Z)); }