Skip to content

st/oxr: properly enable binding to /x and /y

Christoph Haag requested to merge christoph/vec2f_subpaths into master

Store Thumbstick, Trackpad etc. data internally in a vec2f. The knowledge that a binding path ../x and ../y refers to the x and y components of this vec2f is stored as an INPUT_REDIRECT_VEC2_X_TO_VEC1 or INPUT_REDIRECT_VEC2_Y_TO_VEC enum.

Actions now also store the index of the binding paths it matched to, e.g. when an action binds ../trackpad/y to an input that provides bindings [../trackpad, ../trackpad/x, ../trackpad/y], the index 2 is stored.

This approach seems to work well enough without requiring a major overhaul of the binding system though I am concerned about too much confusing special casing if more of those "redirects" are implemented. This code also doesn't handle getting data from any_state yet, since it is a direct value without "redirect" info.

Merge request reports