Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
KEYBDINPUT (Structures)
.
C# Definition:
struct KEYBDINPUT {
public ushort wVk;
public ushort wScan;
public uint dwFlags;
public uint time;
public IntPtr dwExtraInfo;
}
VB Definition:
<StructLayout(LayoutKind.Explicit)> _
Private Structure KEYBDINPUT
Public wVk As Short
Public wScan As Short
Public dwFlags As Integer
Public time As Integer
Public dwExtraInfo As IntPtr
End Structure
User-Defined Field Types:
None.
Notes:
Changed C# definition to use unsigned types (to match WORD and DWORD types). Also made members public.
Using C to dump out the offsets and sizes shows that the full size of an INPUT structure is
28 on x86 and 40 on x64.
The offsets of the KEYBDINPUT structure are (base 10):
x86 x64
000 000 vK
002 002 wScan
004 004 dwFlags
008 008 time
012 016 extraInfo
--- ---
016 024 Total Size of KEYBDINPUT
And remember, the offset of ki in INPUT is 4 on x86 and 8 on x64.
So, a flattened VB.Net declaration that works on both platforms...
<StructLayout(LayoutKind.Sequential, pack:=1)> _
Private Structure KeyInput
Public Type As IntPtr ' INPUT 0
Public Vk As Short ' KEYBDINPUT 0
Public Scan As Short
Public Flags As Integer
Public Time As IntPtr
Public ExtraInfo As IntPtr
Public Reserved As Int64
End Structure
The [KEYBDINPUT] structure contains information about a simulated keyboard event. It's part of the [INPUT] structure, and is used for the SendInput function.
4/10/2012 6:38:31 PM - -77.125.97.109
Used by [user32.SendInput] to store information for synthesizing input events such as keystrokes, mouse movement, and mouse clicks.
6/20/2022 9:40:56 PM - -113.208.118.82
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.