TASEmulators / TASEmulators/BizHawk
Sticky analog input is unusable in combination with mouse input
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
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
- Load an NDS rom (with default controller bindings)
- Load
NDS/StylusInputDisplay.lua - Enter
joypad.setanalog({["Touch X"]=10, ["Touch Y"]=10})in the Lua console - 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.
- 3af5b7a7f0ae512523eae4d93be150dde2384560 onwards (BizHawk 2.10+)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with XorAdapter in src/BizHawk.Client.Common/inputAdapters/BitwiseAdapters.cs and reproduce the NDS case using NDS/StylusInputDisplay.lua, the Lua console, and joypad.setanalog. Trace how mouse and sticky analog values are combined, then establish behavior that makes scripted input usable alongside the default mouse bindings and verify it with the reported reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, lua
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100