We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5257 - SDL_JoystickGetHat Never Reports LEFTDOWN
Summary: SDL_JoystickGetHat Never Reports LEFTDOWN
Status: RESOLVED ENDOFLIFE
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 1.2.15
Hardware: ARM Linux
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-14 17:29 UTC by gmesmer
Modified: 2021-01-08 07:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gmesmer 2020-08-14 17:29:19 UTC
Whenever polling SDL_JoystickGetHat, all inputs can be seen (numbers 0 to 9) except LEFTDOWN (number 5). When visibly holding LEFTDOWN on Hat 1, calling SDL_JoystickGetHat reports eiter down (1) or left (2) and cycles between these two on a repeatable basis. The controller is sending those values over as seen in other libraries (html based applications, sdl2, etc). 

Using the alterative SDL_PollEvent with SDL_JOYHATMOTION does report LEFTDOWN so there is an issue with the function SDL_JoystickGetHat.
Comment 1 gmesmer 2020-08-14 18:04:24 UTC
new info, actually down is (4) and left is (8) while LEFTDOWN reports as (12121212 repeated)
Comment 2 gmesmer 2020-08-14 18:11:08 UTC
Actually the LEFTDOWN reports as 12 (twelve) instead of 5
Comment 3 Sam Lantinga 2020-12-09 14:47:53 UTC
What controller and version of OS are you using?
Comment 4 gmesmer 2021-01-08 06:02:29 UTC
(In reply to Sam Lantinga from comment #3)
> What controller and version of OS are you using?

this is using a nintendo switch pro controller (though it can be replicated on other controllers in my testing)

ubuntu 18.04.1 LTS arm64
should be using sdl1.2 from the latest apt package provided
Comment 5 Sam Lantinga 2021-01-08 07:00:04 UTC
SDL 1.2 is no longer supported. Please let me know if you see this with SDL 2.0.