The Key Combo Match Event.
This event is dispatched by the Keyboard Plugin when a Key Combo is matched.
Listen for this event from the Key Plugin after a combo has been created:
this.input.keyboard.createCombo([ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13 ], { resetOnMatch: true });
this.input.keyboard.on('keycombomatch', function (event) {
console.log('Konami Code entered!');
});
name | type | description |
---|---|---|
keycombo | Phaser.Input.Keyboard.KeyCombo |
The Key Combo object that was matched. |
event | KeyboardEvent |
The native DOM Keyboard Event of the final key in the combo. You can inspect this to learn more about any modifiers, etc. |