Closed ilexp closed 5 years ago
SDL2 seems to have switched to a different controller mapping string format between 2.0.4, 2.0.5 and 2.0.6, which means the new SDL2 source input mappings cannot be used as they are. It could be worth extending the format implementation in OpenTK to match.
More links:
OpenTK issues that may or may not be distantly related, but that could provide a good opportunity to read up on related input concepts and implementations:
IUserInput.Description
and IUserInputSource.Description
API to Id
.ProductId
and ProductName
to the same API, which are currently implemented using the hardware GUID and gamepad mapping name.ProductId
and ProductName
to both logs and the Input Handling sample display.duality-master
vs. the most recent opentk/develop
and opentk/4.0
to manually cherry-pick / copy-paste improvements and fixes.
Input
and Platform
folders.Investigating the OpenTK Joystick GUID structure and comparing old vs. new SDL2 gamepad mapping schemes, it seems like the switch was from (by example):
ffff0000000000000000504944564944
PID VID P I D V I D
4c056802000000000000504944564944
PID VID P I D V I D
to
03000000ffff00000000000000000000
? PID VID
030000004c0500006802000000000000
? PID VID
Which means it should be possible to make the same switch in OpenTK. Need to investigate first whether that GUID is used anywhere to query OS / hardware functionality, which might require a specific format.
duality/upstream-merge
branch where opentk/develop
changes from Input and Platform folders have been merged into the Duality-specific OpenTK version. So far, nothing that looks like it would cause this bug was changed, though some smaller tweaks and other input-related bugfixes made it as well.opentk/4.0
as well, but the relevant input and platform code seems to be equivalent with the exception of style changes. Skipping this.Ran the InputTest linked above with a potentially different, but probably similar SNES controller from iNNEXT with and without SDL2.
Without SDL
PS4 DualShock 4 controller 03000000-4c05-0000-cc09-000000000000; PS4 Controller Right analog's Y axis mapped as L2 trigger (mapped 0...1, 0.5 at rest) R2 trigger mapped as Right analog's Y axis (mapped -1...1) L2 trigger is seen as R2 trigger
XBox 360 wired controller 78696e70-7574-0000-0000-000000000000; XInput Controller Working ok
With SDL 2.0.8 x64
PS4 DualShock 4 controller 03000000-4c05-0000-cc09-000000000000; PS4 Controller Working "ok" (see below)
XBox 360 wired controller 03000000-5e04-0000-8e02-000000007801; XInput Controller Working "ok" (see below)
In both cases, with SDL, the Left and Right triggers start at 0.5 - once pressed they report correctly from 0 in rest position to 1 fully pressed
@SirePi Thanks! Since the PS4 Controller seems to have some problems, can you check the InputHandling sample from the latest Duality master
branch version? Does it work there? If it doesn't, does it fail in the same way?
Talked to @SirePi about the PS4 Controller issue.
With SDL: https://gfycat.com/DescriptiveEthicalCub Without SDL: https://gfycat.com/CreepyFabulousCoypu
Without SDL, the mapping is off, one of the triggers is mapped to a sticks Y axis and vice versa. Could this be a similar issue as with the iNNEXT SNES controller, such as SDL enumerating axes differently?
Looked into different axis behaviors between SDL2 and OpenTK with iNNEXT SNES.
@SirePi Can you check whether there's any change to PS4 controller behavior on the most recent InputTest3.zip download?
Edit: Talked to SirePi on the chat. No changes in PS4 controller behavior after the recent fix.
Sadly, no changes
master
.Closing this.
Summary
The iNNEXT SNES Controller only works partially in Duality / OpenTK. Investigate the cause and fix this.
How to reproduce
Workaround
SDL2.dll
in the Duality folder fixes this in the launcher at least.Analysis
duality-master
vs. the most recentdevelop
and4.0
to cherry-pick improvements and fixes. Look into changes inInput
andPlatform
folders.