UserInputService
Class | Source Code
Constructors
Section titled “Constructors”new UserInputService()
Section titled “new UserInputService()”Properties
Section titled “Properties”static onKeyUp: Event
Section titled “static onKeyUp: Event”Triggered on the single instance where a key goes from being down to being up.
By the time this is triggered, the service has been updated to reflect the new key event.
static onKeyPressed: Event
Section titled “static onKeyPressed: Event”Triggered continuously so long as a key is pressed.
By the time this is triggered, the service has been updated to reflect the new key event.
static onKeyDown: Event
Section titled “static onKeyDown: Event”Triggered on the single instance where a key goes from being up to being down.
By the time this is triggered, the service has been updated to reflect the new key event.
Methods
Section titled “Methods”isKeyUp(key: string): boolean
Section titled “isKeyUp(key: string): boolean”Returns
Section titled “Returns”Whether the specified key is currently released.
isKeyPressed(key: string): boolean
Section titled “isKeyPressed(key: string): boolean”Returns
Section titled “Returns”Whether the specified key is currently pressed.
isChordPressedExclusively(keys: string[]): boolean
Section titled “isChordPressedExclusively(keys: string[]): boolean”Returns
Section titled “Returns”Whether only the keys necessary for the specified chord are pressed.
isChordPressed(keys: string[]): boolean
Section titled “isChordPressed(keys: string[]): boolean”Returns
Section titled “Returns”Whether the specified chord is currently pressed. Note that other keys could also be pressed. If you want to know if only the keys necessary for this chord are pressed, use UserInputService.isChordPressedExclusively.