I’ve been working on a project (ok, a game!) that of course involves being able to accept different types of input from different devices. Naturally, I started by putting together a PG to test out and quickly iterate my code. Here’s the result:
W, A, S, D - move left, right, up, down
Shift, CTRL - move in/out
Arrow keys - rotate
Enter, Click, Tap, X (gamepad), Start, etc - Change color of box to random color
It’s pretty basic, but I hope it demonstrates to the community how you might approach being able to do things like this. The final code for my project is pretty close to this, but with a number of important differences having mostly to do with Scenes needing to co-habitate in the same application nicely (I still haven’t solved some problems to my satisfaction - specifically including support for debouncing).
If you’re curious, you can look at where the various pieces of the PG ended up in the code here.
LMK if I can answer any questions!
ed: silly me, forgot to mention – this supports Keyboard, Mouse, Touch, and Xbox gamepads