rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.22k stars 263 forks source link

Input text ENTER key event #284

Closed meet-logicwind closed 2 years ago

meet-logicwind commented 2 years ago

Hi,

is there any event in the input text plugin to detect ENTER key?

I don't want to keep the separate button to get the confirmation from the user when he is done with typing instead if the user presses the enter key I am moving ahead with that.

I checked the events but couldn't get the idea of how to use those to match the above scenario.

Thanks

rexrainbow commented 2 years ago

Press enter-key event:

scene.input.keyboard.once('keydown-ENTER', function() {
    inputText.setBlur();
})
rexrainbow commented 2 years ago

There are two advance plugins for text-input: