Skip to content

Input stuff - #4804

Open
SuuperW wants to merge 8 commits into
TASEmulators:masterfrom
SuuperW:input-stuff
Open

Input stuff#4804
SuuperW wants to merge 8 commits into
TASEmulators:masterfrom
SuuperW:input-stuff

Conversation

@SuuperW

@SuuperW SuuperW commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR changes both JoypadApi.SetAnalog overloads, so that they behave similarly to the Set methods for buttons. This means (1) using OverrideAdapter instead of the sticky controller [fixes the Lua issue observed in #4766], (2) changing the way analog values are unset in the dictionary overload is by passing a dictionary without the relevant keys [allowing it to set neutral axis values], and (3) for Lua, throwing an exception if the input value cannot be converted to an int [instead of silently failing].

The documentation for the set methods are updated to include "as if the inputs came from the user". This implies that #4769 is indented behavior; auto-fire will obviously work when the button is not otherwise held. Sticky holds and autofires will also interact with buttons held by joypad.set. But this implication is probably not very obvious and better documentation may still be beneficial. Alternatively, we might want to change the behavior.

It also fixes the behavior of the set methods when called from the frame start event, adds tests, and cleans up some code a little bit.

Check if completed:

SuuperW added 8 commits July 26, 2026 13:27
- ButtonOverrideAdapter -> OverrideAdapter because it isn't just for buttons
- ClickyVirtualPadController -> ClickyController because it is not related to the Virtual Pad tool
…not need to know how to use it

fix: Soft/Hard reset menu items did not work if Lua was calling `joypad.set` from `onframestart` event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant