Skip to content

Sticky analog input is unusable in combination with mouse input #4535

Description

@kalimag

Summary

(follow up on a question in the scripting channel by tortoiseplaysvr)

Sticky input (used by the virtual pad, joypad.setanalog etc.) is applied with the XorAdapter, which is forcing the axis to its neutral value if both the regular input and the sticky input are non-neutral. Mouse inputs are basically never neutral unless the mouse is very precisely positioned at the center point, so it's effective unusable. This particularly affects NDS touch input (which has mouse bindings by default), and potentially other systems (e.g. DOSBox). The only workaround seems to be unbinding the mouse.

Not sure what to do about this, maybe it's just "working as intended", but it seems very inconvenient and unintuitive. At least Lua/tools should be able to force specific input.

Repro

  1. Load an NDS rom (with default controller bindings)
  2. Load NDS/StylusInputDisplay.lua
  3. Enter joypad.setanalog({["Touch X"]=10, ["Touch Y"]=10}) in the Lua console
  4. Crosshair will be stuck in the center of the bottom screen, unless the mouse is positioned exactly over the X/Y center of the touchscreen

Host env.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions