Web SDK - HeldKeys

Home > rainway-sdk > HeldKeys

HeldKeys class

An interface for querying which keyboard keys are currently held down (locally, on the web page).

Signature:

export declare class HeldKeys 

Constructors

ConstructorModifiersDescription
(constructor)(heldKeys)Constructs a new instance of the HeldKeys class

Properties

PropertyModifiersTypeDescription
altbooleanReports whether either Alt key is pressed.
ctrlbooleanReports whether either Ctrl key is pressed.
keysReadonlySet<VirtualKey>Returns all held keys as a ReadonlySet.
shiftbooleanReports whether either Shift key is pressed.
winbooleanReports whether either Windows/Meta key is pressed.

Methods

MethodModifiersDescription
has(key)Reports whether the given VirtualKey is pressed.