Keyboard
Index
Constructors
Properties
Methods
Constructors
constructor
Returns Keyboard
Properties
publicevents
Methods
publicclear
Returns void
publicemit
Type parameters
- TEventName: EventKey<KeyEvents>
Parameters
eventName: TEventName
event: KeyEvents[TEventName]
Returns void
publicgetKeys
Gets list of keys being pressed down
Returns Keys[]
init
Initialize Keyboard event listeners
Parameters
optionalkeyboardOptions: KeyboardInitOptions
Returns void
publicisHeld
Tests if a certain key is held down. This is persisted between frames.
Parameters
key: Keys
Test whether a key is held down
Returns boolean
publicoff
publicon
Type parameters
- TEventName: EventKey<KeyEvents>
Parameters
eventName: TEventName
handler: Handler<KeyEvents[TEventName]>
Returns Subscription
publiconce
Type parameters
- TEventName: EventKey<KeyEvents>
Parameters
eventName: TEventName
handler: Handler<KeyEvents[TEventName]>
Returns Subscription
toggleEnabled
Parameters
enabled: boolean
Returns void
publictriggerEvent
Trigger a manual key event
Parameters
type: down | up
key: Keys
optionalcharacter: string
Returns void
publicupdate
Returns void
publicwasPressed
Tests if a certain key was just pressed this frame. This is cleared at the end of the update frame.
Parameters
key: Keys
Test whether a key was just pressed
Returns boolean
publicwasReleased
Tests if a certain key was just released this frame. This is cleared at the end of the update frame.
Parameters
key: Keys
Test whether a key was just released
Returns boolean
Provides keyboard support for Excalibur.