TASEmulators / TASEmulators/BizHawk

Sticky analog input is unusable in combination with mouse input

Open
#4,535 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

App: EmuHawk Repro: Affects 2.11.1 Repro: Regression from 2.9.1
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
  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.
  • 3af5b7a7f0ae512523eae4d93be150dde2384560 onwards (BizHawk 2.10+)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.