예제 #1
0
 /// <summary>
 /// Returns information about a simulated keyboard event.
 /// </summary>
 /// <param name="wvk">A virtual-key code. The code must be a value in the range 1 to 254. If the <paramref name="dwFlags"/> member specifies <see cref="KeyBoardInputDwFlag.KEYEVENTF_UNICODE"/>, <paramref name="wvk"/> must be 0.</param>
 /// <param name="dwFlags">A hardware scan code for the key. If <paramref name="dwFlags"/> specifies <see cref="KeyBoardInputDwFlag.KEYEVENTF_UNICODE"/>, <paramref name="wScan"/> specifies a Unicode character which is to be sent to the foreground application.</param>
 /// <param name="wScan">Specifies various aspects of a keystroke.</param>
 /// <param name="time">The time stamp for the event, in milliseconds. If this parameter is zero, the system will provide its own time stamp.</param>
 /// <param name="dwExtraInfo">An additional value associated with the keystroke. Use the <see cref="User32.GetMessageExtraInfo"/> function to obtain this information.</param>
 /// <returns></returns>
 public static UInt32 SendKeyboardInput(KeyCode wvk, KeyBoardInputDwFlag dwFlags, UInt16 wScan = 0, UInt32 time = 0, IntPtr dwExtraInfo = default(IntPtr))
 => User32.SendInput(
     pInput: InputFactory.CreateKeyboardInput(
         wvk: wvk,
         dwFlags: dwFlags,
         wScan: wScan,
         time: time,
         dwExtraInfo: dwExtraInfo));