Input stuff - #4804
Open
SuuperW wants to merge 8 commits into
Open
Input stuff#4804SuuperW wants to merge 8 commits into
SuuperW wants to merge 8 commits into
Conversation
- ButtonOverrideAdapter -> OverrideAdapter because it isn't just for buttons - ClickyVirtualPadController -> ClickyController because it is not related to the Virtual Pad tool
…d apply for two frames instead of one
…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.
|
I've tested this fix and it works perfectly. My mouse movements no longer override lua script's X/Y positions, and I don't have to manually unbind Touch X and Touch Y whenever I want to run a lua script that does touch inputs. |
YoshiRulz
reviewed
Aug 14, 2026
Contributor
Author
|
Force push, to keep old behavior in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes both
JoypadApi.SetAnalogoverloads, so that they behave similarly to theSetmethods for buttons. This means (1) usingOverrideAdapterinstead 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 old behavior is still available in a
[Obosolete]overload. External tools wishing to make use of this fix will need to be updated for the new method signature. The C# method signature for Lua is identical, so the fixed version uses an updated nameset_analog. Lua scripts usingsetanalogwishing to make use of this fix will need to be updated.The documentation for the set methods are updated to include "as if the inputs came from the user" (same as the new SetAnalog). 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: