GaryStanton / phaser3-merged-input

A Phaser 3 plugin to map input from keyboard & gamepad to player actions
MIT License
34 stars 5 forks source link

Handle `any key` #23

Closed zewa666 closed 2 years ago

zewa666 commented 2 years ago

hey there @GaryStanton

I was wondering of how one would check for any key, mouse or gamepad press. e.g. when starting a game and the intro says press any key to continue

GaryStanton commented 2 years ago

Hi @zewa666, Could you just check for anything in interaction.pressed? That should contain a button press for a single tick, keyboard, game pad or mouse. You may want to exclude direction buttons, but it should work fine.

zewa666 commented 2 years ago

so essentially interaction.pressed !== ""? I'll try that, makes sense

GaryStanton commented 2 years ago

Yes, something along those lines… you’ve caught me while I’m away again so can’t test right now, but I think that should work for you.

GaryStanton commented 2 years ago

@zewa666 did you get that working? Just checking I can close the issue.

zewa666 commented 2 years ago

sry, yes all good

GaryStanton commented 2 years ago

Great, thanks! Let me know when you release the game you’re working on. It’ll be great to see the plug-in in use elsewhere. ;)