Using HAL with Linux Wacom drivers and the xsetwacom/wacomcpl utilities

For a while now, the HAL has been able to detect Wacom tablets and add them to the system for true plug and play functionality.  This is a wonderful feature, but it had a major drawback.  The wacom-tools utilities, xsetwacom and the gui wacomcpl couldn’t see and configure the tablets after they were detected this way.

The reason was simple.  The wacom-tools expect devices with names like “stylus,” “pad,” and “eraser.”  HAL assigns more descriptive names like “Wacom Intuos 6×9.”  When the tool does a search on the X input devices, it finds nothing to work with.  (You can find out what your system wants to call your Wacom tablet by issuing the xinput –list command.)

Thankfully, HAL lets us make changes using the policy files.  Using a simple policy file (placed in /etc/hal/fdi/policy in Ubuntu) you can let the system know to change the names of your Wacom devices and make your tablet fully configurable.  Here is mine:

<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->

<deviceinfo version="0.2">
   <device>
     <match key="input.originating_device" contains="if0">
       <match key="info.product" contains="Wacom">
         <merge key="input.x11_driver" type="string">wacom</merge>
         <merge key="input.x11_options.Type" type="string">stylus</merge>
         <merge key="info.product" type="string">stylus</merge>
         <append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
         <append key="wacom.types" type="strlist">eraser</append>
         <append key="wacom.types" type="strlist">cursor</append>
         <append key="wacom.types" type="strlist">pad</append>
       </match>
     </match>
 </device>
 <device>
   <match key="input.x11_options.Type" contains="eraser">
     <merge key="info.product" type="string">eraser</merge>
   </match>
 </device>
 <device>
   <match key="input.x11_options.Type" contains="cursor">
     <merge key="info.product" type="string">cursor</merge>
   </match>
 </device>
 <device>
   <match key="input.x11_options.Type" contains="pad">
     <merge key="info.product" type="string">pad</merge>
  </match>
 </device>
</deviceinfo>

It’s pretty simple – the policy matches devices that have a certain type, then changes their “product” string to match.

You can also use these files to set your system’s defaults for your tablet.  If you want your ExpressKeys configured to send key presses, or you want your sensitivity turned down on the stylus or eraser, you can add it here.  Any option you could add to Xorg can be added to the FDI file.  Like the product names above, you use the “merge” directive, but instead of “info,” the options are of type “input.x11_options.”  For example, you could add these lines to the “pad” device to control the Express Keys:

<merge key="input.x11_options.Button1" type="string">1</merge>
<merge key="input.x11_options.Button2" type="string">3</merge>
<merge key="input.x11_options.Button3" type="string">3</merge>

As you can see, the FDI files are a flexible and powerful tool for tablet users.  Freeing yourself from the need to have the tablet plugged in at boot makes it much easier to carry along with a laptop, or to store when you aren’t using it.

I couldn’t have put this tutorial together without the help of all the users on the linuxwacom mailing list, and my fellow tableteers at the Ubuntu Forums.

Advertisements

4 Responses to “Using HAL with Linux Wacom drivers and the xsetwacom/wacomcpl utilities”

  1. askdfhkasdhgk Says:

    Hello!
    Perhaps you know if Intuos4 can be used in mouse mode with Gimp successfully despite this bug:
    https://bugzilla.gnome.org/show_bug.cgi?id=154657
    ?

    Or should I not waste time trying to get it working?

  2. askdfhkasdhgk Says:

    Sorry about delay, I forgot about this question (would be great if you had mail notifications for comments)

    Why I want mouse mode? I want to create shortcut key that will act same as “precision mode” in Windows. For that I figured I need to get relative (also known as mouse) mode to work. So far no success.

    https://sourceforge.net/projects/linuxwacom/forums/forum/236871/topic/3645954

    “I only have the stylus, not the puck.”

    What is puck?
    I got stylus and tablet itself. What would puck give me?
    *looks up at wikipedia*
    …oh ok. It’s mouse. However by default it works in absolute mode too from what I can read in description. So I would assume that puck/mouse won’t work either in mouse mode with Gtk applications.

    Also your there is simpler (I hate editing these HAL config files; how is it better than xorg.conf?) way to configure your Wacom Intuos4 tablet using xsetwacom tool, for example:

    xsetwacom set “Wacom Intuos4 6×9 pad” Button4 “key core y”

    My Intuos4 has buttons numbered this way in Ubuntu Karmic 9.10:

    [2] “Wacom Intuos4 6×9 pad” Button2
    [3] “Wacom Intuos4 6×9 pad” Button3
    [4] “Wacom Intuos4 6×9 pad” Button4
    [5] “Wacom Intuos4 6×9 pad” Button5

    [?] “Wacom Intuos4 6×9 pad” AbsWDn
    [1] “Wacom Intuos4 6×9 pad” Button1
    [?] “Wacom Intuos4 6×9 pad” AbsWUp

    [6] “Wacom Intuos4 6×9 pad” Button6
    [7] “Wacom Intuos4 6×9 pad” Button7
    [8] “Wacom Intuos4 6×9 pad” Button8
    [9] “Wacom Intuos4 6×9 pad” Button9

  3. lol Says:

    “Why do you want to use the mouse mode?”

    -> mmmh… why does this mode exist?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: