Struct KeyboardInput
This struct contains information about a simulated keyboard event. See KEYBDINPUT structure
Namespace: Dapplo.Windows.Input.Structs
Assembly: Dapplo.Windows.Input.dll
Syntax
public struct KeyboardInput
Fields
| Improve this Doc View SourcedwExtraInfo
An additional value associated with the keystroke. Use the GetMessageExtraInfo function to obtain this information.
Declaration
public UIntPtr dwExtraInfo
Field Value
Type | Description |
---|---|
UIntPtr |
KeyEventFlags
Specifies various aspects of a keystroke. This member can be certain combinations of the following values.
Declaration
public KeyEventFlags KeyEventFlags
Field Value
Type | Description |
---|---|
KeyEventFlags |
ScanCode
A hardware scan code for the key. If KeyEventFlags specifies Unicode, ScanCode specifies a Unicode character which is to be sent to the foreground application.
Declaration
public ScanCodes ScanCode
Field Value
Type | Description |
---|---|
ScanCodes |
Timestamp
The time stamp for the event, in milliseconds. If this parameter is zero, the system will provide its own time stamp.
Declaration
public int Timestamp
Field Value
Type | Description |
---|---|
System.Int32 |
VirtualKeyCode
A virtual-key code. The code must be a value in the range 1 to 254. If the dwFlags member specifies KEYEVENTF_UNICODE, wVk must be 0.
Declaration
public VirtualKeyCodes VirtualKeyCode
Field Value
Type | Description |
---|---|
VirtualKeyCodes |
Methods
| Improve this Doc View SourceForKeyDown(VirtualKeyCodes, Int32)
Create a KeyboardInput for a key down
Declaration
public static KeyboardInput ForKeyDown(VirtualKeyCodes virtualKeyCode, int timestamp = 0)
Parameters
Type | Name | Description |
---|---|---|
VirtualKeyCodes | virtualKeyCode | Value from VirtualKeyCodes |
System.Int32 | timestamp | optional Timestamp |
Returns
Type | Description |
---|---|
KeyboardInput | KeyboardInput |
ForKeyPress(VirtualKeyCodes, Int32)
Create a KeyboardInput for a key press (up / down)
Declaration
public static KeyboardInput[] ForKeyPress(VirtualKeyCodes virtualKeyCode, int timestamp = 0)
Parameters
Type | Name | Description |
---|---|---|
VirtualKeyCodes | virtualKeyCode | Value from VirtualKeyCodes |
System.Int32 | timestamp | optional Timestamp |
Returns
Type | Description |
---|---|
KeyboardInput[] | KeyboardInput[] |
ForKeyUp(VirtualKeyCodes, Int32)
Create a KeyboardInput for a key up
Declaration
public static KeyboardInput ForKeyUp(VirtualKeyCodes virtualKeyCode, int timestamp = 0)
Parameters
Type | Name | Description |
---|---|---|
VirtualKeyCodes | virtualKeyCode | Value from VirtualKeyCodes |
System.Int32 | timestamp | optional Timestamp |
Returns
Type | Description |
---|---|
KeyboardInput | KeyboardInput |