View Full Version : tablet events broken in X

9th May 2009, 06:45

just upgraded my kubuntu distribution to 9.04 and the app I'm writting no longer receives tablet events :mad:.

Seems X.org is undergoing a transition to hot-pluggable HAL controlled input devices and away from the static configuration in xorg.conf. This means tablet devices may no longer be called "stylus", "eraser" etc but some arbitrary name. This can be configured in the likes of gimp but for QT (from the 4.5 docs):

Notes for X11 Users

Qt uses the following hard-coded names to identify tablet devices from the xorg.conf file on X11 (apart from IRIX): 'stylus', 'pen', and 'eraser'. If the devices have other names, they will not be picked up Qt.

and so dies tablet support...

Anyone know any workarounds?

9th May 2009, 09:19
Your options seem to be either:

Disable the HAL support in your XOrg server
Configure HAL to give you what Qt is expecting

If you don't want to use HAL, you can either build xorg-server without support or you can turn AutoAddDevices option off in the ServerFlags section of your xorg.conf.

Option "AutoAddDevices" "false"

Hal is configured with *.fdi files. The links below might help a little with the second option:

I cannot really help beyond this. :(

9th May 2009, 14:15
ok, I configured HAL to give what QT is expecting...

Here's how I did it (no warranty implied ;):

use lshal to find out what the wacom devices are know by (pipe to less with "lshal | less" and search for wacom). Look for the info.product key. In my case they were "PnP Device (FUJ02e5)" for the stylus and "PnP Device (FUJ02e5) eraser" for the eraser. Take note of the info.udi key or something else that uniquely identifies the entry. My info.uid values were:

"/org/freedesktop/Hal/devices/pnp_FUJ02e5_serial_platform_0" and

now you want to rewrite the info.product key to say "stylus" and "eraser" since this is what QT picks up on ... so create an fdi file in /etc/hal/fdi/policy/ with the following edited for your values:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">

<match key="info.udi" string="/org/freedesktop/Hal/devices/pnp_FUJ02e5_serial_platform_0">
<merge key="info.product" type="string">stylus</merge>

<match key="info.udi" string="/org/freedesktop/Hal/devices/pnp_FUJ02e5_serial_platform_0_subdev">
<merge key="info.product" type="string">eraser</merge>


what it does, is match the entry based on info.udi, and replace the info.product value.

now restart HAL with /etc/init.d/hal restart, check that everything worked with lshal and if it did restart X, and you should be good to go.

phew. It's not exactly what you want an end user of your app to go through, even if they do run linux :D