Phaser API Documentation

  Version: 
Event: COMBO_MATCH
Phaser.Input.Keyboard.Events.COMBO_MATCH
COMBO_MATCH

Description:

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!');
});

Parameters:

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.