User32KeybdEvent(Byte, Byte, KeybdEventFlags, UIntPtr) Method

Synthesizes a keystroke.

The system can use such a synthesized keystroke to generate a WM_KeyDown or WM_KeyUp message.

The keyboard driver's interrupt handler calls the KeybdEvent(VirtualKeys, Byte, KeybdEventFlags, UIntPtr) function.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", EntryPoint = "keybd_event", SetLastError = true)]
public static void KeybdEvent(
	byte vkey,
	byte scanCode,
	KeybdEventFlags flags,
	UIntPtr extraInfo
)

Parameters

vkey  Byte
A virtual-key code.
scanCode  Byte
A hardware scan code for the key.
flags  KeybdEventFlags
Controls various aspects of function operation.
extraInfo  UIntPtr
An additional value associated with the key stroke.

Remarks

See Also