Problem Description
The "LastButton" on a gamepad returns a button press after an axis has been moved in the positive direction, when using both "Every Tick" and "On Any Button Pressed" or when using only "On Any Button Pressed", but not when using "Every Tick" only.
Attach a Capx
http://www.mediafire.com/download/ta5xvu8i9ndv9l9/gamepadError.capx
Description of Capx
It prints out the method(s) it is using to detect button presses, the last button pressed, its value and its raw value.
Steps to Reproduce Bug
- Add Gamepad object
- Add Text object
- Add "On gamepad any button pressed" event
- Set text object's text "Gamepad.LastButton"
- Run the project
- Test with a few buttons
- Push any analogue stick right or down
- Test with a few buttons again
Observed Result
When moving an analogue stick down or right (along an axis in the positive direction), it returns a value from 16 (when moving along axis 0) to 19 (when moving along axis 3) iff using "On any button pressed". The button's value is always 0.
Expected Result
Not changing the returned value, as it is supposed to report only button presses, not axis movements.
Suspected cause
Construct 2's use of a gamepad API, or a bug in the API itself.
Affected Browsers
- Chrome: YES
- FireFox: YES
- Internet Explorer: NOT SUPPORTED
Operating System and Service Pack
Windows 7 Home Premium SP1
Used hardware
Xbox 360 Controller (XInput STANDARD INPUT)
(literal ID)
Construct 2 Version ID
r178 64-bit free edition
(first noticed in r173, I did not own a gamepad before that)