User32KeybdEvent(VirtualKeys, 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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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(
VirtualKeys vkey,
byte scanCode,
KeybdEventFlags flags,
UIntPtr extraInfo
)
<DllImportAttribute("User32.dll", EntryPoint := "keybd_event", SetLastError := true>]
Public Shared Sub KeybdEvent (
vkey As VirtualKeys,
scanCode As Byte,
flags As KeybdEventFlags,
extraInfo As UIntPtr
)
Dim vkey As VirtualKeys
Dim scanCode As Byte
Dim flags As KeybdEventFlags
Dim extraInfo As UIntPtr
User32.KeybdEvent(vkey, scanCode, flags,
extraInfo)
public:
[DllImportAttribute(L"User32.dll", EntryPoint = L"keybd_event", SetLastError = true)]
static void KeybdEvent(
VirtualKeys vkey,
unsigned char scanCode,
KeybdEventFlags flags,
UIntPtr extraInfo
)
[<DllImportAttribute("User32.dll", EntryPoint = "keybd_event", SetLastError = true)>]
static member KeybdEvent :
vkey : VirtualKeys *
scanCode : byte *
flags : KeybdEventFlags *
extraInfo : UIntPtr -> unit
No code example is currently available or this language may not be supported.
Parameters
- vkey VirtualKeys
-
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.