HaxeFlixel / HaxeFlixel/flixel

Gamepad firstJustPressedID() always returns GUIDE instead of NONE for XInput

Open
#2,220 0 comments 1 reaction 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.