-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for pressure-sensitive face buttons #5148
Comments
Feel free to propose an API and submit a PR. |
This didn't go pretty well in #5339... |
For DS3, code landed on this commit I'm not sure about Windows and Linux support. I want to test this on Linux, do I need anything special other than |
@lucasmr You could try seeing if sdl2-jstest supports it? https://gitlab.com/sdl-jstest/sdl-jstest |
1fc7f68 seems pretty clear to me. |
Tested with sdl2-jstest, no change. 6 axes and digital buttons. |
Pcsx2 doesn't seem to have any kind of support for pressure sensitivity on linux (and they were in fact looking forward to SDL to handle the feature) PCSX2/pcsx2#4875 You should try rpcs3 if any RPCS3/rpcs3#5888 (comment) |
Thanks. RPCS3 is accessing DS3 directly via HIDAPI. What I wanted to do was test the DS3 from SDL with the new pressure sensitive code, which also access it via HIDAPI. |
Yes, but I guess something as convoluted as reading RPCS3/rpcs3@839fe78, needs some kind of specific "thoughtfulness" on the side of normal programs (or if not any, even just an innocent assumption in the GUI could lead to whatever misleading). And indeed this looks even more of the case if even a test app is not reporting it properly (despite the fact the "system side" is good if rpcs3 is working). |
This is working here:
Make sure you're running with the new version of SDL, not a system installed version. |
Note that the HIDAPI controller has '68' in the second to last byte. That's how you know the right driver is being used. |
Thanks @slouken, I forgot the environment variable when running sdl2-jstest. I can confirm all 16 axes work! |
Great, thanks! |
Shouldn't this be left open to finalize the thing on other platforms? |
Well, it's not possible on Windows, and works well on macOS. Are there other platforms you're concerned about? |
It *is* possible in windows. |
You need a driver to do this on Windows. The Windows HIDAPI interface won't allow the report that starts input because it's not in the report descriptor for the PS3 controller. |
Of course you need a driver, that's like what I said.. The question here is how (if) to interface with them in SDL. |
Hmm... Currently only two drivers are used by Windows' majority. ReWASD App is quite good using official Sony's DualShock 3 driver under Windows to support pressure sensitivity. On beginning they were just letting to remap pressure sensitive buttons in their app, but in version 6.3.0 they released virtual DS3 controller to emulate pressure sensitive buttons on every controller. Additionally, to make it more useful, they've added official support for Sony's driver to PCSX2 with this commit. This driver is used with Sony Remote Play for Playstation 3, PS Plus Premium and emulator RPCS3. I'm not telling that this driver should be used, but some Windows applications are making very good use of it. Maybe in the future, reWASD will be able to use pressure-sensitive Steam Deck's touchpads to remap them into their virtual DS3 controller (where upper zone will activate triangle, left square, right circle and lower cross) and open support for pressure-sensitive touchpads in emus. On other hand we have @Nefarius's projects where his driver DsHidMini works with GInput, PCSX2 and RPCS3 and maybe will work with new DS4Windows... This driver is preferred by community projects. What is interesting, this driver can be installed on reWASD's DS3 virtual controller too. |
The problem with sixaxis.sys is that I'm pretty sure SDL isn't going to ship/link/use libpad.dll, and so you'd have to interface directly with the absolutely undocumented driver (as if the base library wasn't already offensively mysterious) Anyhow, regardless.. I guess like you could support even more than a single driver per controller. Though there should probably be a market and a reason for it. |
Feel free to submit a PR for Windows support using either of those drivers. |
My qualm was just addressing the status of this issue |
Already does for like over a year. All in my README and docs 😉 EDIT: oh you meant our fork, yeah, likewise, the bare basics already work 👍 |
If the virtual device behaves exactly like the hardware then that is working as expected 👍 |
did they add this in yet? and if so, has it been implemented on the flatpak? |
Is it expected that pressure sensitivity works only when the controller is connected via USB ? Whenever I connect it via bluetooth I only see 6 axis. |
My uneducated guess would be (if we are talking about hidapi on linux, right?) that's a bug, possibly in the kernel code that handles one of the interfaces. AFAIR ds3 had no capabilities difference between wireless and wired mode. |
Do you have any idea how I could find the issue ? I'm using SDL 2.26.5 provided by debian 12, and I'm using |
Bluetooth mode is fixed for SDL 3.0 in 32d015a |
It has came to my attention that on windows (with the "official" driver) you aren't just loosing analog buttons without HIDAPI. |
Rejoice for #9144 |
Hello, did you used SDL 2 or SDL3? I'm still getting only 6 Axes with SDL 2.30.3 |
@SAMGARTNER I believe the button pressure data comes through as unmapped axis, so you won't see them being counted as an axis. It's a shame, but pressure axis mapping won't be added. |
The issue here is that the HIDAPI driver isn't being used for some reason. That's usually a permissions issue on the hidraw device. |
🙏 in Slouken's comment he showed he got the 16 axes although he used sdl2-jstest and I used Grumbel's jstest-sdl (https://github.com/Grumbel/sdl-jstest) with a few changes that I made to show the version and the variable. What's not clear for me is whether he used SDL3 or SDL2 |
Thank you very much for chiming in, I'm not very GNUL savvy, any advice?, I need a big road sign. UPDATE: Ok I just notice this on the official docs, I thought it was also included on the last SDL2
|
After installing the latest 3.x version of SDL on Raspberry Pi OS I'm getting:
It would be awesome to have full support for analogue / pressure sensitive buttons. I came here because I have been testing GTA Vice City on the Pi 5 and this was the first thing I noticed being missing. I don't know if this is an issue with the port, or if this is a system wide issue so I thought I'd chime in here ;) |
|
Good catch - I was copying / pasting from earlier replies on this issue but must not have copied the whole line. I'll have another try when I'm back with the Pi in a couple of days. The version of GTA Vice City is the native linux one installed by PiKISS. I've asked the PiKISS maintainer if it's possible to have pressure sensitive buttons in Vice City. Running jstest-gtk shows the DS3 pad ok and the main axes work but the buttons are showing as buttons and not axes. I read somewhere that before Sony removed the pressure sensitive button feature from the kernel that people used to see lots of axes in jstest-gtk and it caused some confusion. Should the buttons be showing as axes in jstest-gtk or does the application need to use SDL? Apologies for my lack of knowledge and for any silly questions! |
It's not as simple as installing SDL3, on Windows you don't need SDL for that, you have to use a driver such as dshidmini and the GInput mod that works specifically for Windows (to support analog buttons), on Linux and other platforms there is not GInput equivalent. The only two available paths are either to develop an SDL3 compatible GInput equivalent or for Lutris and Proton (steam) to provide full Xinput compatibility layer. The good news is that both PCSX2 and RPCX3 are both moving to SDL3 thanks to it's analog button support, so there is already open source code for that. PD: also keep in mind that SDL2-JTEST might have been compiled with SDL2 I have been checking a different fork and it has no support for SDL3 |
I'm fairly sure that HIDAPI should work even through wine. The problem if any is that the format that is linux native isn't the one used by the windows drivers (because the DS3 descriptors are broken and everywhere need to be overridden to get anything). |
I think if I'm not mistaken that @nefarius 🙇♂️created a custom XInput.dll to bridge Ginput and DSHidMini so maybe there is a third path for this. Maybe this is not the right place to ask this but, what would be the approximate bounty for a freelancer to implement this feature? |
Of course! Apologies for any confusion here. My I totally forgot about the 'GinputVC.asi' and 'GinputVC.ini' files that are needed (see here for more info https://gtaforums.com/topic/562765-ginput/) for force feedback buttons to become active on the Windows version of Vice City. Just for clarification I'm using a Pi5 running Raspberry Pi OS and have installed PiKISS which has a native port of the Vice City (and GTA 3 too) engine where you copy the Windows game files over to it to run the game. I forgot about the required hack / mod files as it's about 4 years since I got it working on Windows 10 and assumed it "just worked" last time and that the tricky part I had was getting the joypad to work on Windows in general with pressure sensitive buttons. When I saw that the buttons were acting in a digital manner though I installed jstest-gtk and saw 6 axes and all the buttons were showing as buttons. So I began searching for a solution. I found this post here: https://www.reddit.com/r/linux_gaming/comments/zq5byy/is_there_support_for_the_duel_shock_2_3_analog/ Which links to here: https://codeberg.org/fabiscafe/game-devices-udev - but when this didn't work I stumbled upon this issue. The issue I'm having it system wide i.e. I was expecting to see all the axes present in jstest-gtk. I'm away from my pi for the next day but is all that I need to do is run "SDL_JOYSTICK_HIDAPI_PS3=1" from the command line before running jstest-gtk ? As for GTA Vice City I'll add to my issue here: jmcerrejon/PiKISS#228 |
Works perfectly well https://docs.nefarius.at/projects/DsHidMini/v2/SCP-XInput-Bridge/ |
How did they manage to port the engine to PiKISS? I mean I know there are reverse engineering efforts but I didn't know they were complete |
I'm assuming it's from here: https://github.com/halpz/re3 - on the PiKISS install scripts though it's downloading a pre-built binary but the folder names in the script make it look like it's from here. |
I have got forwarded here from my feature request for Xbox emulator to add pressure-sensitive face buttons for Xbox OG controller, DualShock 2 and DualShock 3. But it is even better, as direct feature in SDL can lead to creating good quality tools for these devices.
Actually we do not have now good quality drivers for Xbox and DualShock 2 controllers supporting unique feature which are pressure-sensitive buttons. DualShock 3 has this support in DsHidMini and reWASD application.
Xbox OG controller has 3 drivers on Windows:
DualShock 2 has drivers where Mayflash's supports only 2 from 12 pressure sensitive buttons and Bliss-Box's allows to remap only 4 of 12 pressure sensitive buttons. Not satisfying solution as rest works as digital buttons.
I would like to ask for implementation pressure-sensitive face buttons which later can be used as DirectInput axes for every pressure sensitive button. Support of pressure sensitive buttons should be preserved as they still can give a lot of fun. They will let enjoy applications like reWASD, PS2, PS3, Xbox emulators and even GInput mods for old GTA III, VC and SA where pressure-sensitive option is used already by DualShock's 3 DsHidMini drivers.
Pressure sensitive controllers:
The text was updated successfully, but these errors were encountered: