Score:0

joystick.conf isn't stopping all gamepads from acting as mouse+keyboard on Xubuntu Studio 22.04

us flag

My setup is a gaming PC with numerous controllers and emulators + Steam. Currently it has these:-

js0 - Xbox controller (24C6:581A) - joysticks sometimes controls mouse

js1 - PS4 Dualshock4 red (054C:054C) - doesn't control mouse

js2 - PS4 Dualshock4 white (054C:054C) - doesn't control mouse [identical vendor and product ID]

js3 - PS4 Dualshock4 black (054C:09CC) - touchpad always controls mouse

I have edited two joystick.conf files:- /usr/share/X11/xorg.conf.d/50-joystick.conf /etc/X11/xorg.conf.d/51.joystick.conf

to the following:-

```Section "InputClass"
Identifier "joystick catchall"
MatchIsJoystick "on"
MatchDevicePath "/dev/input/event*"
Driver "joystick"
# These Two Lines Disable the mouse emulation
Option "StartKeysEnabled" "off"   
Option "StartMouseEnabled" "off" 
EndSection```

which is recommended here:-

Turn off controller from moving mouse

===

I have 3 questions about this:-

  1. Why do the rules seem to only prevent two of the controllers from taking over the mouse+keyboard?

  2. Are there any other places the system might keep these rules? This PC started off as Ubuntu Studio and had XfCE installed over it

  3. Certain games (e.g. ToeJam& Earl) have stopped detecting the controllers at all since I turned off StartKeysEnabled and StartMouseEnabled. Could it be that these games rely on X treating controllers as mouse+keyboard? And the same games often had two controllers totally overlapping with 2 players controlled by both gamepads - could that be because two of the controllers happen to have identical vendor and product IDs.

Score:0
gh flag

I have the a black PS4 controller with the same id's.

Bus 003 Device 002: ID 054c:09cc Sony Corp. DualShock 4 [CUH-ZCT2x]

I made it over an udev rule.

cat /etc/udev/rules.d/51-disable-PS4-touchpad.rules 
SUBSYSTEM=="input", ATTRS{name}=="*Controller Touchpad", RUN+="/bin/rm %E{DEVNAME}", ENV{ID_INPUT_JOYSTICK}=""

This will remove the device node for the touchpad, could also work with other controller, this I can not check.

Note: Totally forgot. Please revert your changes in the files /usr/share/X11/xorg.conf.d/50-joystick.conf and /etc/X11/xorg.conf.d/51.joystick.conf before.

evild4ve avatar
us flag
This would also prevent the touchpad working in-game though, wouldn't it? Since udev is at the kernel level? I only want to stop X above this from using the gamepad as its input outside of games.
nobody avatar
gh flag
In game I can not check but I think you are right. I most play with PS* consolen.
Score:0
us flag

I've partially solved this myself (if I manage to fully solve it I'll edit this answer, if that's the right etiquette):-

  1. My black Playstation controller was switched On under the Applications>Settings>Mouse and Touchpad>Device dropdown menu. The red and white Playstation controllers were switched Off, which must be why only the black controller was working. It seems that on Xfce (or at least on this system) the joystick.conf rules are ignored in favour of this UI and presumably the UI is editing a config file somewhere else on the system that I haven't seen yet.

On closer inspection, the Xbox controller seems to be made into a mouse+keyboard by Steam, rather than behaving this way from startup. The Xbox controller isn't listed in the Mouse and Touchpad dropdown menu I mentioned above.

If Steam is closed, the Xbox controller continues to act as a mouse+keyboard. But anecdotally I think Steam probably isn't expected to cleanly return all the devices to their former states when it shuts down. I don't plan to debug Steam, I can live with rebooting after closing Steam, or perhaps I can find some script to reset all the mouse+keyboard devices.

==

EDIT (26/10/2022 - 19:30 GMT)

  1. In addition to the above, I have made an additional udev rule to try and fix each gamepad to a specific js# device ID, following the advice on this page: https://ubuntuforums.org/showthread.php?t=1595666

And also I installed an Xbox controller driver from https://github.com/paroj/xpad

After this, for various games that weren't detecting the controllers, I found that this could be fixed by reinstalling them or changing which versions of Wine or Proton they used. Although I remain very confused by how many different places the settings are saved in, and by the multiplicity of ways different games can approach gamepad support (e.g. whether they refer to event# numbers or js# numbers), the Ubuntu-side difficulties I think are mostly resolved now.

  1. The udev rules recommended on various forums were having no effect at all for my system. On my system the important things are (i) whether Steam has been opened and allowed to apply its Desktop settings to the controllers and (ii) the 'Mouse and Touchpad' UI in the Xfce Applications menu.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.