This is the easiest way to set-and-forget input => action mapping.
Or, it's a helper to remove actions -- setAction(action, [])
will simply clear the action away.
For input strings:
MouseLeft, MouseRight, or MouseMiddle.KeyA, KeyB, ...Digit0, Digit1, ...ArrowLeft, ArrowRight, ArrowUp, ArrowDownShiftLeft, ShiftRightSpaceMinusEqual (also has a plus sign)BracketLeft and BracketRightSemicolonQuoteBackquote (also has tilde)BackslashCommaPeriodSlashBackspaceEnter
Used to map inputs (from keyboard, mouse, or gamepad) into actions.
setAction allows for set-and-forget mappings. Good for one-off games.
Example:
For more sophisticated games, see also:
These allow for programmatic binding based on events. For example: