![Xcalibur Systems LLC Logo](../icons/logo.png) |
EventHelperGetKeyState Method |
Retrieves the status of the specified virtual key. The status specifies whether the key is
up, down, or toggled (on, off—alternating each time the key is pressed).
GetKeyState function Namespace: Xcalibur.NativeMethods.V2.EventsAssembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax[DllImportAttribute("user32.dll", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Auto)]
public static short GetKeyState(
int virtualKey
)
<DllImportAttribute("user32.dll", CallingConvention := CallingConvention.StdCall,
CharSet := CharSet.Auto>]
Public Shared Function GetKeyState (
virtualKey As Integer
) As Short
public:
[DllImportAttribute(L"user32.dll", CallingConvention = CallingConvention::StdCall,
CharSet = CharSet::Auto)]
static short GetKeyState(
int virtualKey
)
[<DllImportAttribute("user32.dll", CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Auto)>]
static member GetKeyState :
virtualKey : int -> int16
Parameters
- virtualKey Int32
- A virtual key. If the desired virtual key is a letter or digit
(A through Z, a through z, or 0 through 9), nVirtKey must be set to the ASCII value of
that character. For other keys, it must be a virtual-key code.
If a non-English keyboard layout is used, virtual keys with values in the range ASCII A
through Z and 0 through 9 are used to specify most of the character keys.For example, for
the German keyboard layout, the virtual key of value ASCII O(0x4F) refers to the "o" key,
whereas VK_OEM_1 refers to the "o with umlaut" key.
Return Value
Int16
See Also