uinput devices
Tomas Carnecky
tom at dbservice.com
Sat Apr 4 00:09:28 PDT 2009
On Apr 4, 2009, at 5:31 AM, Erik de Castro Lopo wrote:
> Hi all,
>
> I've working on a uinput device (currently in userspace) and trying
> to get it hooked up to Xorg (on Ubuntu).
>
> So far, I have a minimal driver which when run comes up in
> /proc/bus/input/devices as:
>
> I: Bus=0006 Vendor=abcd Product=0001 Version=0001
> N: Name="Touchscreen (userspace)"
> P: Phys=
> S: Sysfs=/devices/virtual/input/input19
> U: Uniq=
> H: Handlers=event10
> B: EV=1
>
> I notice that everytime I restart my userspace driver the Sysfs
> entry changes (say input10 one time, input11 the next). Should
> this be happening or am I doing something wrong?
No, you're doing everything correctly. The kernel gives each input
device an ID which increases with every new device.
> If this changes everytime I run the driver, how do I create a entry
> in xorg.conf to use? Should I be using udev to create a symlink?
If you have a hal-enabled xserver, it should pick up new devices
automatically. If you want to use xorg.conf, the best way is to refer
to the device by bus/vendor/product or the unique identifier. Your
device doesn't seem to have a unique identifier, but maybe it's not
possible in uinput. But if your bus/vendor/product is always the same,
simply use that. Another way is to use udev to automatically assign
fixed names to devices, so that you can use Device "/dev/input/xyz" in
xorg.conf. But again, no idea if udev works on uinput devices.
tom
More information about the xorg
mailing list