HaxeFlixel / HaxeFlixel/flixel
Gamepad firstJustPressedID() always returns GUIDE instead of NONE for XInput
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
Call FlxG.gamepads.firstActive.firstJustPressedID() with an xbox controller plugged in. It will always return GUIDE when nothing is pressed.
The reason is simply that the the raw ID for the guide button on xbox controllers is -1, which is also the id flixel uses for NONE. We hit https://github.com/HaxeFlixel/flixel/blob/master/flixel/input/gamepad/mappings/XInputMapping.hx#L34 when doing getID(-1) and it returns.
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 at flixel/input/gamepad/mappings/XInputMapping.hx line 34 and trace how firstActive.firstJustPressedID() handles the raw XInput guide-button ID when no button is pressed. Verify the idle result for an Xbox controller is NONE rather than GUIDE, while preserving the guide-button mapping when it is actually pressed.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100