Bind touch input to an action
You can use touch input with Actions, like any other pointer device. To use actions with touch devices:
- Associate bindings to the pointer controls available in the
Pointerclass. For example,<Pointer>/pressor<Pointer>/delta.
This gets input from the primary touch, and any other non-touch pointer devices.
Get input from multiple touches
If you want to get input from multiple touches in the action:
- Use bindings like
<Touchscreen>/touch3/pressto bind to individual touches. - Alternatively, use a wildcard binding to bind one action to all touches. For example,
<Touchscreen>/touch*/press.
If you bind a single action to input from multiple touches, set the action type to pass-through so the action gets callbacks for each touch, instead of just one.