Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Oct 2015 01:02:18 +0200
From:      Jan Beich <jbeich@vfemail.net>
To:        Arto Pekkanen <isoa@kapsi.fi>
Cc:        x11@freebsd.org
Subject:   Re: X.org devd hotplug backend ignoring uhid devices, prevents using gamepads with X.org
Message-ID:  <wpv6-tcp1-wny@vfemail.net>
In-Reply-To: <560C3890.7020004@kapsi.fi> (Arto Pekkanen's message of "Wed, 30 Sep 2015 22:31:28 %2B0300")
References:  <560C3890.7020004@kapsi.fi>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Arto Pekkanen <isoa@kapsi.fi> writes:

> Section "InputClass"
> 	Identifier "Game Controller"
> 	Driver "joystick"
> 	Option "MatchIsJoystick" "on"

MatchIsJoystick only works on devices that are assigned ATTR_JOYSTICK.
config/devd currently only does so for joy(4) devices but not uhid(4) as
the latter isn't specific to joysticks. The proper detection may require
teaching it to speak usbhid(3) but for now see inlined patch at the end.

MatchIsJoystick is specified just like the following line. It isn't an
option passed to a X11 driver.

> 	MatchDevicePath "/dev/uhid*"

config/devd is a bit too pessimistic. Any device not in hw_types table
seems to be ignored by default, so MatchDevicePath may not be applied.
For one, config/udev only ignores non-ID_INPUT devices which translates
for USB into intclass=0x03 in devd(8).

> EndSection
[...]
> I would like to get my gamepad working as a genuine X11 input device,
> preferably hot pluggable. There are plenty applications that support
> the X11 input layer and can use gamepads and other widgets. One such
> application that comes to mind is Wine.

FWIW, emulators/joytran maybe more useful for Wine unless all your games
have the same keybindings.

Index: x11-servers/xorg-server/files/patch-config_devd.c
===================================================================
--- x11-servers/xorg-server/files/patch-config_devd.c	(revision 398150)
+++ x11-servers/xorg-server/files/patch-config_devd.c	(working copy)
@@ -1,6 +1,6 @@
 --- config/devd.c.orig	2015-05-19 19:41:49 UTC
 +++ config/devd.c
-@@ -0,0 +1,531 @@
+@@ -0,0 +1,533 @@
 +/*
 + * Copyright (c) 2012 Baptiste Daroussin
 + * Copyright (c) 2013, 2014 Alex Kozlov
@@ -80,9 +80,11 @@
 +	{ "ums", ATTR_POINTER, "mouse" },
 +	{ "psm", ATTR_POINTER, "mouse" },
 +	{ "vboxguest", ATTR_POINTER, "vboxmouse" },
-+	{ "joy", ATTR_JOYSTICK, NULL },
-+	{ "atp", ATTR_TOUCHPAD, NULL },
-+	{ "uep", ATTR_TOUCHSCREEN, NULL },
++	{ "joy", ATTR_JOYSTICK, "void" },
++	/* XXX joystick is more useful than void by default */ 
++	{ "uhid", ATTR_JOYSTICK, "joystick" },
++	{ "atp", ATTR_TOUCHPAD, "mouse" },
++	{ "uep", ATTR_TOUCHSCREEN, "egalax" },
 +	{ NULL, -1, NULL },
 +};
 +

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQF8BAEBCgBmBQJWDbt6XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF
NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bJ6IIAOBmj3Ynsl0jzI331sJj6A9b
66C0thzVTR9JFJCJMb9Nv19qaHsF+FeMefBDaYhgURJ3yd1fFsd9C/HTVyjoQsSd
Vh7ud/Akd8fbbtOnpC/bzmzaiwkYJ7k5rZgNS7IWjsAgqiKduMnj8dXWtwhJp3lj
0sKh/grN+6ibpFLpKyPpbmqbKVGzAHPoOMCKavXCkI61EpOGt7ZwP/Y+w017SmHF
gG/n2fSjhCg45hQrFW7A8mtnRnj37ig1MPftuSEr04cerUoPjZ93+aO9JED1KJSD
vkZgKfck86yMeApe14QdHRK8scvvRpZXtUAqTJi8ZiiIkYQ74rFVjXgVU08MReY=
=rUTG
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?wpv6-tcp1-wny>