InputKeyboardSource.GetCurrentKeyState(VirtualKey) Method

Definition

Retrieves the state of the supplied virtual-key at the current time (which could be after the input message currently being processed, if the input queue contains unprocessed messages).

public:
 virtual VirtualKeyStates GetCurrentKeyState(VirtualKey virtualKey) = GetCurrentKeyState;
VirtualKeyStates GetCurrentKeyState(VirtualKey const& virtualKey);
public VirtualKeyStates GetCurrentKeyState(VirtualKey virtualKey);
function getCurrentKeyState(virtualKey)
Public Function GetCurrentKeyState (virtualKey As VirtualKey) As VirtualKeyStates

Parameters

virtualKey
VirtualKey

The virtual-key for which the state is returned.

Returns

The flags indicating the state of the supplied virtual-key at the current time

Remarks

When handling a KeyDown event, this method might report that the key state is None instead of Down if the KeyUp event is already in the message queue.

Note

All keys support the Locked state (not just the standard Caps Lock and Num Lock keys).

Applies to

See also