Gamepads: Add conditions to check buttons by numerical ID #1993
+121
−2
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.
Changes
Added IsButtonPressedByID: A condition to check if a button is held down using its ID.
Added IsButtonJustPressedByID: A condition to trigger only once when a button is first pressed.
Added IsButtonReleasedByID: A condition to trigger when a button is released.
Improved Flexibility: Users can now support any non-standard button (like IDs 17, 18, 19) without modifying the extension's source code.
How to use the new features
Find the new conditions: In the events sheet, search for "Gamepads" and look for conditions with "(by ID)" in their name.
Gamepad identifier: Enter the player number (1, 2, 3, or 4).
Button ID: Enter the numerical index of the button.
Example: For most controllers, 0 is 'A/Cross', 1 is 'B/Circle'.
Special buttons: Use IDs like 17 or 18 for specialized arcade sticks or extra buttons that don't have standard names.
Dynamic Support: You can use a variable in the Button ID field (e.g., Variable(MyButton)) to let players remap their controls dynamically.
Checklist
Example file
example.zip
Extension file
Gamepads.zip
Extension by @Edytor-Studio
You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type
!update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!