Fixed joystick POV values not being set properly for devices that are…#1719
Merged
Conversation
|
Tested this PR with the joystick example with my controller Torid Speedlink. It's got two modes, XInput and DirectInput (dunno which is which), and both appear to work fine. (Just the second sees the back triggers as on-off buttons instead of analog input. But I think that's a controller thing.) https://i.imgur.com/aiD9ebg.gif (Windows 10 Pro, 64 bit. Compiled the current version of Visual Studio 2019.) |
MarioLiebisch
approved these changes
Nov 29, 2020
MarioLiebisch
left a comment
Member
There was a problem hiding this comment.
Seems to be working fine with my Saitek X-55 (incompatible with XInput). All 8 hat directions follow the same coordinates pattern as a Xbox One Conotroller (using XInput).
… accessed via DirectInput.
930ea28 to
26a7b04
Compare
eXpl0it3r
approved these changes
Dec 28, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

This fixes an issue where joystick/controller POV values were not set correctly for devices that are accessed via DirectInput.
See: #1634 (comment)
DirectInput provides a combined value for both X and Y hat directions, this value has to be translated back to the separate X and Y values that SFML exposes through its API. Previously the implementation erroneously treated X and Y hat axes as separate objects which could only work if the device reported the same hat twice as distinct objects. This was the case with some devices but not all causing this bug to not always be reproducible.
This fix was tested with both a joystick and a controller (the same one mentioned in the linked comment).