public Keyboard Press(params VirtualKey[] keys) { foreach (var key in keys) { KeyboardPInvoke.keybd_event((byte)key, VirtualKeyBreak.GetBreak(key), 0x1, (UIntPtr)0); } return(this); }
public Keyboard Press(params VirtualKey[] keys) { foreach (var key in keys) { var flag = key.IsExtendedKey() ? KeyboardFlag.ExtendedKey : 0; var scan = KeyboardPInvoke.MapVirtualKey((uint)key, 0) & 0xFFU; KeyboardPInvoke.keybd_event((byte)key, (byte)scan, (uint)flag, (UIntPtr)0); } return(this); }