eudev-project / eudev

Repository for eudev development
GNU General Public License v2.0
523 stars 147 forks source link

DS4 touchpad is missing ID_INPUT_TOUCHPAD. #154

Closed Sur3 closed 6 years ago

Sur3 commented 6 years ago

Hi my DualShock 4 touchpad didn't work because ID_INPUT_TOUCHPAD was missing, I therefore wrote a rule to get the touchpad functional with libinput: SUBSYSTEM=="input", KERNELS=="0003:054C:09CC.", ATTR{device/name}=="Sony Interactive Entertainment Wireless Controller Touchpad", ENV{ID_INPUT_TOUCHPAD}="1" SUBSYSTEM=="input", KERNELS=="0005:054C:09CC.", ATTR{device/name}=="Wireless Controller Touchpad", ENV{ID_INPUT_TOUCHPAD}="1"

This is a 2016v2 version, don't know about the first version, but probably it will be: SUBSYSTEM=="input", KERNELS=="0003:054C:05C4.", ATTR{device/name}=="Sony Interactive Entertainment Wireless Controller Touchpad", ENV{ID_INPUT_TOUCHPAD}="1" #TODO: check name SUBSYSTEM=="input", KERNELS=="0005:054C:05C4.", ATTR{device/name}=="Wireless Controller Touchpad", ENV{ID_INPUT_TOUCHPAD}="1" #TODO: check name

See also: https://bugs.freedesktop.org/show_bug.cgi?id=105050#c10

Greetz Si

whot commented 6 years ago

fwiw, this shouldn't be fixed with a custom rule for this device, given the evdev codes this should always be tagged as touchpad anyway. a more generic version is needed (or a fix of whatever tags touchpads right now).

blueness commented 6 years ago

@whot agreed. @Sur3 I'm confused by your suggestion, wasn't this fixed upstream by the following: https://github.com/systemd/systemd/pull/8259

Sur3 commented 6 years ago

@blueness, I'm not using systemd but OpenRC, therefore whatever that systemd bug fixed didn't affect me. Also that bug seems to be about not to assign "ID_INPUT_TOUCHPAD" and "ID_INPUT_MOUSE" at the same time, my problem is none of that were assigned at all, only the generic "ID_INPUT".

blueness commented 6 years ago

@Sur3 still @Whot is right, i can't add a custom rule for just this device.

Sur3 commented 6 years ago

@blueness then we should research why the generic rule doesn't work.. @whot which part of the evdev codes exactly tells udev that it's a touchpad..? https://bugs.freedesktop.org/show_bug.cgi?id=105050#c2

whot commented 6 years ago

look at the systemd udev-builtin input_id.c please

Sur3 commented 6 years ago

Ok I compared the input_id.c code from eudev and systemd, seems systemd also accepts ABS_MT_POSITION_X/Y for setting a dev as touchpad, whereas eudev checks only for ABS_X/Y and doesn't accept MT coordinates to set a device as touchpad..

blueness commented 6 years ago

systemd's test_pointers() in udev-builtin-input_id.c has quite a few changes which address joysticks, touchpads, touchscreens, etc. I'm going to have to sort through those and import. @Sur3 if I provide you with a patch, can you test it?

blueness commented 6 years ago

@Sur3 @whot can you testing the latest git head. commit dba4728 import's upstreams work on test_pointers(). Let me know if this properly addresses your issue.

Sur3 commented 6 years ago

Ok thanks, I'll test that.

Sur3 commented 6 years ago

Tried .9999.ebuild but all ID_INPUT* are missing, so even my mouse and keyboard were non-functional.

blueness commented 6 years ago

Okay, let me revert and test at my end before pushing again.

blueness commented 6 years ago

Actually there is another problem with -9999 from recent contributions which may be causing your failure with all ID_INPUT* missing. I know how to fix this, but I'm going to have to unravel some changes since 3.2.5.

Sur3 commented 6 years ago

Yes or you could provide a patch, for the the new test_pointer so I can test that with 3.2.5 if that is easier for you..?

blueness commented 6 years ago

I've scheduled fixing this for Wednesday. There are some bad rules that were important uncritically by a contributor. I'll ping you then.

blueness commented 6 years ago

Okay I found the problem. Commit bb070c1 forgot to include the installation of 60-input-id.rules and 70-joystick.rules via the Makefile. Without this, commits dba4728 and 5df0137 leave the system without any useable input devices.

@Sur3 please test git/head again.

Sur3 commented 6 years ago

Hi, mouse, keyboard and touchpad work fine now. Only problem so far is when connecting over bluetooth the gamepads udev rules seem to be only executed on first connect, if I remember correctly disconnecting and reconnecting the gamepad over bluetooth worked fine before, I'll test with 3.2.5 again if it works there..

Sur3 commented 6 years ago

Nope same problem with 3.2.5, so it's probably not udevs fault but a bluetooth problem, because with usb everything works fine now. ^^

blueness commented 6 years ago

@Sur3 that's a different bug.