pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

Input:SDL: Allow use of axes and buttons outside the normal range

Open TellowKrinkle opened this issue 3 years ago • 15 comments

Description of Changes

Allow use of buttons outside of normal defined GameController range

Rationale behind Changes

This might allow DS3s to use analog axes

Suggested Testing Steps

Test DS3s and see if they can use analog axes

TellowKrinkle avatar Sep 12 '22 22:09 TellowKrinkle

Tested it, same behavior. Can't rebind with the controller.

lucasmr avatar Sep 12 '22 23:09 lucasmr

@lucasmr Okay how about now

TellowKrinkle avatar Sep 13 '22 02:09 TellowKrinkle

nope

lucasmr avatar Sep 13 '22 15:09 lucasmr

@lucasmr To clarify because I think there's a communication breakdown here:

This PR should allow a DS3 to be bound by a pressure sensitive axis. Your phrasing suggests your issue is a DS3 not binding at all. Can you clarify which of the two you are experiencing?

RedPanda4552 avatar Sep 13 '22 17:09 RedPanda4552

Sorry, let me be more clear. The UI doesn't respond to the DS3 buttons at all, nothing binds it. I can only bind buttons to keyboard or mouse clicks. It is detected, though. I can alter the rumble strength.

lucasmr avatar Sep 13 '22 20:09 lucasmr

Ohh That's not how I was interpreting it (Side note, I tested with a modified SDL where I mapped my controller's sticks to axes 6, 7, 8, and 9, and it did work there after the second commit)

Does the DS3 show up in the list of connected controllers? Also, if you use the DS3 with a program that lists all SDL axis and button outputs, can you report what values it gives for the pressure axes?

TellowKrinkle avatar Sep 13 '22 20:09 TellowKrinkle

$ sdl-jstest/build/sdl2-jstest --list
error: failed to read gamecontrollerdb.txt: Invalid RWops
Found 1 joystick(s)

Joystick Name:     'PS3 Controller'
Joystick GUID:     0300afd34c0500006802000000016800
Joystick Number:    0
Number of Axes:    16
Number of Buttons: 15
Number of Hats:     0
Number of Balls:    0
GameControllerConfig:
  Name:    'PS3 Controller'
  Mapping: '0300afd34c0500006802000000016800,*,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,crc:d3af,platform:Linux'

Via sdl2-jstest: image

The controller, detected on pcsx2: image

lucasmr avatar Sep 13 '22 20:09 lucasmr

Did you remember to use SDL_JOYSTICK_HIDAPI_PS3=1 this time?

mirh avatar Sep 13 '22 20:09 mirh

ohhh This change only affects Qt builds wx builds are stuck with no controller remapping, and that probably won't change before we remove wx

TellowKrinkle avatar Sep 13 '22 20:09 TellowKrinkle

image That's from the qt build, automatic mapping. I can also rebind with the controller now. Rebinding manually gives a slightly different result, might be relevant for pressure: image

The regular upstream qt build works as well, and it doesn't show the axes for buttons when rebinding. So I suppose they are not pressure sensitive if not assigned to an axis.

lucasmr avatar Sep 13 '22 21:09 lucasmr

Just tested with Burnout, I can confirm the pressure sensitivity worked after manually binding on your branch. The direction is wrong, though: button released was full throttle.

lucasmr avatar Sep 13 '22 21:09 lucasmr

Manually open up the ini and edit the -s to +s to invert. While you're at it, you can remove SDL-0/DPadUp & part.

TellowKrinkle avatar Sep 14 '22 01:09 TellowKrinkle

The button values ranges from: -32768: released +32767: fully pressed

There's only a response after the button goes beyond 0, or half the pressure.

lucasmr avatar Sep 14 '22 10:09 lucasmr

@lucasmr Can you try the latest build and change +Axis## to FullAxis##? (Note: I didn't add support to the auto detection, only manual INI edits)

TellowKrinkle avatar Sep 15 '22 04:09 TellowKrinkle

I managed to test with padtest.elf, to avoid non linear translation in games. I can say the pressure correlates very close to sdl2-jstest values!

lucasmr avatar Sep 15 '22 08:09 lucasmr

Now with the release of SDL 2.26, can this work be merged?

lucasmr avatar Nov 18 '22 19:11 lucasmr