new KeyCombo(keyboardPlugin, keys [, config])
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
keyboardPlugin |
Phaser.Input.Keyboard.KeyboardPlugin | A reference to the Keyboard Plugin. |
|
keys |
string | Array.<number> | Array.<object> | The keys that comprise this combo. |
|
config |
Phaser.Types.Input.Keyboard.KeyComboConfig |
<optional> |
A Key Combo configuration object. |
- Since: 3.0.0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 13)
Listens to Events:
Members
-
current :number
-
The current keyCode the combo is waiting for.
Type:
- number
- Since: 3.0.0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 114)
-
deleteOnMatch :boolean
-
If the combo matches, will it delete itself?
Type:
- boolean
- Since: 3.0.0
- Default Value:
-
- false
- Source: src/input/keyboard/combo/KeyCombo.js (Line 202)
-
enabled :boolean
-
A flag that controls if this Key Combo is actively processing keys or not.
Type:
- boolean
- Since: 3.0.0
- Default Value:
-
- true
- Source: src/input/keyboard/combo/KeyCombo.js (Line 74)
-
index :number
-
The current index of the key being waited for in the 'keys' string.
Type:
- number
- Since: 3.0.0
- Default Value:
-
- 0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 123)
-
keyCodes :array
-
An array of the keycodes that comprise this combo.
Type:
- array
- Since: 3.0.0
- Default Value:
-
- []
- Source: src/input/keyboard/combo/KeyCombo.js (Line 84)
-
manager :Phaser.Input.Keyboard.KeyboardPlugin
-
A reference to the Keyboard Manager
Type:
- Since: 3.0.0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 65)
-
matched :boolean
-
Has this Key Combo been matched yet?
Type:
- boolean
- Since: 3.0.0
- Default Value:
-
- false
- Source: src/input/keyboard/combo/KeyCombo.js (Line 152)
-
maxKeyDelay :number
-
The max delay in ms between each key press. Above this the combo is reset. 0 means disabled.
Type:
- number
- Since: 3.0.0
- Default Value:
-
- 0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 182)
-
<readonly> progress :number
-
How far complete is this combo? A value between 0 and 1.
Type:
- number
- Since: 3.0.0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 252)
-
resetOnMatch :boolean
-
If previously matched and they press the first key of the combo again, will it reset?
Type:
- boolean
- Since: 3.0.0
- Default Value:
-
- false
- Source: src/input/keyboard/combo/KeyCombo.js (Line 192)
-
resetOnWrongKey :boolean
-
If they press the wrong key do we reset the combo?
Type:
- boolean
- Since: 3.0.0
- Default Value:
-
- 0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 172)
-
size :number
-
The length of this combo (in keycodes)
Type:
- number
- Since: 3.0.0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 133)
-
timeLastMatched :number
-
The time the previous key in the combo was matched.
Type:
- number
- Since: 3.0.0
- Default Value:
-
- 0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 142)
-
timeMatched :number
-
The time the entire combo was matched.
Type:
- number
- Since: 3.0.0
- Default Value:
-
- 0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 162)
Methods
-
destroy()
-
Destroys this Key Combo and all of its references.
- Since: 3.0.0
- Source: src/input/keyboard/combo/KeyCombo.js (Line 269)