new Key()
Key is used by Keyboard, Pointer, etc, to represent a key state.
- Source:
Members
(static) DOWN :number
Key down event.
Type:
- number
- Source:
(static) RESET :number
Key reset event.
Type:
- number
- Source:
(static) UP :number
Key up event.
Type:
- number
- Source:
justPressed :boolean
Indicates if this key was just pressed.
Type:
- boolean
- Source:
justReleased :boolean
Indicates if this key was just released.
Type:
- boolean
- Source:
pressed :boolean
Indicates if this key is currently pressed.
Type:
- boolean
- Source:
Methods
reset()
Reset key to default values.
- Source:
set(justPressed, pressed, justReleased)
Set this key attributes manually.
Parameters:
Name | Type | Description |
---|---|---|
justPressed |
boolean | Indicates if the button was just pressed. |
pressed |
boolean | Indicates if the button is currently being pressed. |
justReleased |
boolean | Indicates if the button was just released. |
- Source:
update(action)
Update Key status based on new key state.
Parameters:
Name | Type | Description |
---|---|---|
action |
number | Key action that was performed. |
- Source: