public static void CreateKeyboardPress(bool shift, bool ctrl, bool alt, byte virtualkey) { if (shift) { WinAPIUtils.keybd_event(16, 0, 0, 0); } if (ctrl) { WinAPIUtils.keybd_event(17, 0, 0, 0); } if (alt) { WinAPIUtils.keybd_event(18, 0, 0, 0); } WinAPIUtils.keybd_event(virtualkey, 0, 0, 0); WinAPIUtils.keybd_event(virtualkey, 0, 2, 0); if (shift) { WinAPIUtils.keybd_event(16, 0, 2, 0); } if (ctrl) { WinAPIUtils.keybd_event(17, 0, 2, 0); } if (alt) { WinAPIUtils.keybd_event(18, 0, 2, 0); } }
public static void CreateKeyboardUp(byte virtualkey) { WinAPIUtils.keybd_event(virtualkey, 0, 2, 0); }