Wacom Tablet HOWTO Stefan Runkel <runkel@runkel-it.de> v1.0.8, 2001-08-11 Installation of Wacom graphic tablets under linux and / or xfree86 Copyright

Copyright (c) 1999,2000 by Stefan Runkel

This document describes the installation of Wacom tablets under linux. It may be distributed, at your choice, under either the terms of the GNU Public License version 2 or later or the standard Linux Documentation Project terms. These licenses should be available from where you got this document. Please note that since the LDP terms don't allow modification (other than translation), modified versions can be assumed to be distributed under the GPL. Introduction

Nevertheless I think it should be easy to adapt the shown concepts to other products.

I have written this document because I have not found a document about this subject which contained completely what I wanted to know. So I got small parts of information from various people in the net and assembled them to this HOWTO. Regarding the questions of my readers, I must realize that this document also is not complete and never will be. But from the same questions I can tell that it helped many people on the way, and each new question lets this HOWTO grow. New Versions of this Document

or at Acknowledgements

ArtZ II series (known in Europe as the UltraPad series - the same UltraPad name also was used for earlier tablets that only work partially.) ArtPad II PL300 (combined LCD screen and tablet) Pen Partner Graphire alias FAVO (mouse and pen, get at least the alpha 16 driver for full support from ). Intuos series (support may be only partial with the driver of your distribution, get updated alpha versions from

The older SD and HD series are not supported by the standard XFree86 driver, however, a modified driver that supports these devices as well some OEM products with embedded screens including the IBM Thinkpad 360 PE and Toshiba T200 is available from:

USB-Devices If ordering the wacom products intuos and graphire, you can choose between two different interfaces: Serial and USB.

The Serial Interface is available for a long time, so the drivers are more stable for it can not supply power to the tablet. For graphire and small intuos, wacom made an interface wire that plugs between the ps/2 keyboard and the computer to grap that power. Bigger intuos tablets may use an AC-adapter. does not require you to recompile the kernel or to load kernel modules.

The USB Interface is newer, so the drivers may be still in development. can supply power to the tablet, bigger intuos tablets nevertheless may use an AC-adapter. may require you to recompile the kernel and / or to load kernel modules The section later in this document tries to guide you through this process. Which Software is needed

For XFree, the keyword is XInput. This specification has to be supported by device drivers which provide extra information. In turn, XInput has to be understood by programs which want to use alternative pointer devices.

There is a big number of programs based on the gtk library. The gtk has XInput support and makes it very easy to use. At least the following applications support XInput:

The Gimp - a powerful image manipulation program in the style of Photoshop. The 1.1.x instable development version includes XInput support as a standard feature. We are awaiting the next stable release, Version 1.2.x.

gsumi - a simple B/W drawing program that supports drawing / erasing with pressure and tilt sensitivity. Get it from the gsumi web page:

xink (By Ralph Levien) - another rudimentary drawing program for X.

xink is available from:

RasMol - a molecular visualization program that supports a hardware dial box using XInput. look at .

xinput (by Frederic Lepied) - a very useful utility for configuring and testing XInput devices.

USB-Support is done in the kernel. This means that you should be able to configure and recompile the kernel. If you do not know how, consult your local guru.

The Kernel Make sure in the USB Support section of the kernel configuration you have the following set: --- USB Human Interface Devices (HID) USB Human Interface Device (full HID) support ... Wacom Intuos/Graphire tablet support Now recompile the kernel, either load the wacom module (which would be in /lib/modules/<linux version>/kernel/drivers/usb/wacom.o), or reboot, and verify that the module was loaded: # grep -i wacom /var/log/boot.msg input0: Wacom Intuos 9x12 on usb1:2.0 On some system you may want to grep in /var/log/messages instead.

Note: At least for the intuos series even the latest kernel (2.4.7 as of moment of writing) doesn't have the right Wacom USB driver, so you have to get the right one and recompile the stuff. See for this.

I can not tell if wacom graphire works fine with the original driver. But take for sure that the shown __concepts__ will work for both wacom product lines.

Tablets as Mouse-Replacement for the Linux-Console

The Wacom driver of gpm 1.18.0 and below seems to be for the very old artpad models, the documentation does not say anything about this. I tested it with ultrapad, penpartner, graphire and intuos models but it did not work. I have rewritten the wacom driver for gpm, to use it you need at least gpm version 1.18.2 . Since 1.18.2, the old wacom driver has been replaced with my driver for wacom graphire, penpartner and ultrapad products.

However, if you own an old artpad, use gpm < 1.18.1 and try: killall gpm ; gpm -t wacom -m /dev/ttyS0 and it should work.

If you own a graphire, use gpm > 1.18.1 instead and use

for the relative (mouse-like) mode: killall gpm ; gpm -t wacom -o relative -m /dev/ttyS0 for the absolute (tablet-like) mode: killall gpm ; gpm -t wacom -o absolute -m /dev/ttyS0

Of course, you get only the buttons and the movement function, pressure and tilt are not supported because they are not too useful in text-based applications. There is no support for ultrapad macro buttons or graphire mouse wheel.

If you use gpm and XFree86, you may or may not run in problems, because normally a device can be opened only by one program at a time. There are two solutions for that:

The gpm repeater mode. If you start gpm with the "-R protocol" option, it will repeat all data it gets to the device /dev/gpmdata. Let us say, you have a ps2 type mouse and your gpm call looks like: gpm -t ps2 -Rmman then gpm gets your ps2 mouse data and tries to translate this into a mman packet, which it will emit to /dev/gpmdata. Unfortunately, gpm can translate to only a few protocols at the time of writing. Since gpm 1.18.1, these protocols to which can be translated are marked with an asterix at the first column. Again, do a gpm -t help to get the list.

If you want to omit the translation and only get the data byte for byte, just call gpm -t ps2 -R raw . You can then make XFree use that second device by putting the line Device "/dev/gpmdata" in your XF86Config in the pointer section or the XInput section.

If you use startx, you can modify it that it does a gpm -k before the X-Server is started. This option kills a running gpm. Tablets with XFree 3 and XFree 4

If you must use any prior version, XInput support should be available since 3.1.2.d.

XInput support in XFree is configured basically in a file called XF86Config. In most cases the XF86Config file is located in /etc or in /etc/x11. I will show now two very short configuration sections, the first works with XFree 3, the other is for XFree 4. I will explain then what can be changed and why this is needed. Sample XF86Config snippet for XFree 3

Because the usage can be seen from the above examples, this difference will be considered as clear for the rest of the document. Section Module

XFree 3: Load "xf86Wacom.so" XFree 4: Load "wacom"

This has to appear only once per XF86Config file. Device Type (XF3) and Type (XF4)

The penpartner and graphire products simply recognize the type of a device, but they can not distinguish them. For example, you can not use two different pens, say, one configured red and one configured blue - all what these products say is: "I found a pen tip on my surface", or "I found an Eraser on my surface", or "I found a mouse on my surface".

XInput maps the device types to devices, these device types are later specified in XF86Config. For XFree 3 this is a subsection in the section XInput, for XFree 4 this goes to individuell InputDevice sections. The devicetypes are: WacomStylus Tip of a pen or airbrush WacomEraser Eraser of a pen or airbrush WacomCursor Mice, like graphire mouse, lens cursor, 4d-mouse As you can see from above examples, device types are specified with the keyword "Devicetype" in XFree 3 and with Option "Type" in XFree 4. DeviceName (XF3) and Identifier (XF4)

USB Tablets

USB is treated as a serial line too, so this statement is mandantory. If you connect your product to the USB, you have to specify this with .

Example how to use the USB-Port (XF4):

Section "InputDevice" Driver "wacom" Identifier "stylus" Option "Device" "/dev/input/event0" Option "Type" "stylus" Option "Mode" "absolute" Option "USB" "on" Option "Tilt" "on" EndSection

Switching The Mouse Off

Most people use both, the mouse and the tablet for core pointer functions. However, if you want to switch your mouse off and only will use your tablet, here comes the trick for that: First, specify AllowMouseOpenFail in section ServerFlags. Then set the device to a file which must not exist (fake or dummy). Do not set it to /dev/null as this will eat up your CPU-time.

Example how to switch off the mouse (XF3):

Section "Pointer" Device "/dev/fake" #Phony device file ... EndSection

Example how to switch off the mouse (XF4):

Section "ServerLayout" ... InputDevice "Mouse0" "CorePointer" ... EndSection Section "InputDevice" Identifier "Mouse0" ... Option "Device" "/dev/fake" #Phony #device file Endsection DebugLevel

Example (XFree 3): SubSection "WacomStyLus" # Pen DeviceName "PenRed" # Name, choose it free ... DebugLevel 10 # be very verbose ... EndSubSection Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "DebugLevel" "10" # be very verbose ... EndSection Serial Num (intuos series only)

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "Serial" "2609917443" ... EndSection Section "InputDevice" Identifier "PenBlue" # Name, choose it free Option "Type" "stylus" ... Option "Serial" "2609918664" ... EndSection

It should be said that combined input devices like pens have only one serial number. The driver uses the serial number it gets to recognize one specific pen and the device type to distinguish the tip of that specific pen from its eraser.

How to find out the serial number of a device

Set DebugLevel to 6 Start the X-Server by typing X 2>t Tip all devices down on the tablet and make a notice of the order you tipped them. Kill the X-Server (usually Ctrl+Alt+Backspace) Do a grep serial_num t

You should get a list of your different numbers.

Serial Num - Example of what has been logged (XFree 3)

BEGIN xf86WcmProc dev=0x8354d60 priv=0x833e3f0 type=stylus flags=9 what=1 xf86WcmProc pWcm=0x8354d60 what=ON END xf86WcmProc Success what=1 dev=0x8354d60 priv=0x833e3f0 device_id=0x96 serial_num=2595227137 type=cursor [cursor] abs prox=false x=0 y=0 z=0 button=false buttons=0 (serial_num is in Line 4 Word 2).

Mode absolute, Mode relative

If you set a device in mode relative, you will get the well known behavior of a mouse. This means, that if you take the mouse off from the surface, move it and go down again, the pointer does (ideally) not move.

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... Mode absolute ... EndSubSection EndSection

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "Mode" "absolute" ... EndSection

Device Modes Extension, Core, AlwaysCore

The other pointer is used by applications which want more information, like pressure and tilt. This is the extension device.

Starting with version 3.3.3.1, the Statement AlwaysCore tells the driver that it should send both types of events.

If you do not specify Alwayscore in your XF86Config, then this device is initially used as extension device, this means it is usable only in applications but you can not control the menus of your window manager with it.

If Alwayscore is given, then your device acts as core pointer (in addition to the mouse) as well as it sends tilt and pressure information to applications which opened the device in extension mode.

You can configure two different logical devices, one in Core-Mode and one in Extension-Mode, to the same physical device. To do so, simply type two identical sections, only the DeviceName statement must differ. Then specify AlwaysCore only for the last section.

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... AlwaysCore ... EndSubSection EndSection

For XFree 4, this is not an option in the InputDevice section, it goes to the Serverlayout section and can be one of: AlwaysCore / SendCoreEvents or CorePointer: Example (XFree 4): Section "ServerLayout" Identifier "XFree86 Configured" Screen 0 "Screen0" 0 0 ... InputDevice "icursor" "AlwaysCore" EndSection

HistorySize

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... HistorySize 200 ... EndSubSection EndSection

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "HistorySize" "200" ... EndSection

Suppress

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... Suppress 10 ... EndSubSection EndSection

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "Suppress" "10" ... EndSection

TiltMode (XF3) and Tilt (XF4)

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... TiltMode ... EndSubSection EndSection

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "Tilt" "on" ... EndSection

MaxX, MaxY, MaxZ (since alpha 20)

ResolutionX, ResolutionY, ResolutionZ (since alpha 20)

TopX, TopY, BottomX, BottomY Statements

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... TopX 0 TopY 5000 BottomX 5000 BottomY 10000 ... EndSubSection EndSection

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "TopX" "0" Option "TopY" "5000" Option "BottomX" "5000" Option "BottomY" "10000" ... EndSection

Getting the maximal X, Y Values, current configuration, and the resolution

If you use the above four statements, you sometimes want to make some calculations on the size and position of the rectangle to be defined. Often the maximal tablet coordinates and the resolution are needed for this. To get these values, start your server: X 2>t . Kill the X-Server (usually Ctrl+Alt+Backspace) and do a grep &dquot;X=&dquot; t .You should get back the values in question.

Getting Resolution - Example of what has been logged

(--) Wacom IV tablet maximum X=5103 maximum Y=3711 X resolution=1000 Y resolution=1000 suppress=6 (--) Wacom tablet top X=0 top Y=0 bottom X=5103 bottom Y=3711 (--) Wacom tablet top X=0 top Y=0 bottom X=5103 bottom Y=3711 (--) Wacom tablet top X=0 top Y=0 bottom X=5103 bottom Y=3711

KeepShape

Any given BottomX, BottomY statement is ignored, because these values will be calculated.

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... KeepShape ... EndSubSection EndSection

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "KeepShape" "1" ... EndSection

Threshold

This is available since alpha 16 and is used to control the minimum pressure that is needed to detect that a tool is pressed on the surface. It works with intuos and graphire. Please note that the integer value has to be coded as String, unlike all other integer values.

Example (XFree 3): Section "XInput" SubSection "WacomStylus" # Pen DeviceName "PenRed" # Name, choose it free ... Threshold "5" ... EndSubSection EndSection

Example (XFree 4): Section "InputDevice" Identifier "PenRed" # Name, choose it free Option "Type" "stylus" ... Option "Treshold" "5" ... EndSection

USB (since alpha 20)

Changing configuration from within a running X-Server

Gimp must know which devices it should use and in what mode. You have to open the File/Dialogs/Input Devices - dialog for setting this up. You will find two listbox-controls at the top of that window labeled Device and Mode . Choose the device to set up from the Device control and choose a mode from the Mode -control.

The modes are: disabled: Gimp does not use this device. window: Gimp uses this device, the cursor is drawn by the application. The cursor can not leave the active window. The active area of the tablet is mapped to this window. screen: Gimp uses this device. The cursor is drawn by the X-Server. The cursor can move over the whole screen. The active area of the tablet is mapped to the screen.

If you see two cursors linked to your device, you have two solutions: Use mode screen but you may or may not loose the special gimp-tool cursors; If so, all cursors will be replaced by the pen cursor. Configure two different devices in the XF86Config file, one AlwaysCore and one not. Tell gimp to use the later one in mode window. If you do so and have one of the statements TopX, TopY, BottomX, BottomY in your XF86Config, take care to use the same adjustments for that statements in both logical devices. If you do not, then you get confused because X draws a cursor of the one device while the other is active. the effect of this is a cursor, very far away from the point of action (hotspot).

Below the two listbox-controls there is a tab-control with the two register tabs Axes and Keys . Axes assigns an axis a function, it is mostly not necessary to change this. But think about a touch-screen device which is built in a table rotated by 90 degrees, then you might want to swap the x and y axis.

Some tablets have so called macro keys at the top which may hold some often used functions. The

Now we should talk about how the devices can be used. Open the File/Dialogs/Device Status -dialog. Open an image.

You set up each device independently from each other in gimp.

If you move the cursor with different devices in the image window you can see the devices change in the Device Status dialog. If you pick a tool, brush, pattern or color with a device, again the changes are reflected in the dialog. You can save the settings in the Status Dialog, so that they will be restored before your next session.

The Switch Device

For the moment, let us forget the whole XInput stuff and think of a left-hander who just wants to swap the left and right mouse buttons. You would execute xmodmap -pp to look what the current assignment is. You should get the following table back: Physical Button Button Code 1 1 # ( Left Button ) 2 2 # ( Right Button ) 3 3 # ( Middle Button )

To swap the buttons, you do a xmodmap -e &dquot;pointer = 2 1 3&dquot; , and to get back, xmodmap -e &dquot;pointer = default&dquot; . This should work with every device with at least two buttons. Note that the term &dquot;pointer = x x x&dquot; has to be quoted to prevent it from being changed by the shell. Button Mapping with xinput for Devices in Extension Mode

To swap the side-switches, you would do a xinput list to get a list of the devices and their current settings. Swapping is done with xinput set-button-map Pen1 1 3 2 where Pen1 is the Device to change.

Starting with XFree 3.3.2 this works also with devices that are configured AlwaysCore in XF86Config. xsetmode - changing absolute / relative mode

With xsetmode you can change the mode of a device between absolute and relative.

Example: xsetmode GraphireMouse ABSOLUTE . xsetpointer - setting the default core device

Do a xsetpointer Devicename . The old core-device (usually the mouse) is not usable anymore and the one you specified should be active. For example I can make the graphire mouse the standard core device from within a running XFree.

xsetpointer -l lists all devices and the modes they are in. Keys

xinput -l gives information about the number of keys and things like the first scancode.

Utilities to use more than one tablet and for toggle support on / off

I have written two utilities which should make live easier with that: The shell script sx for those who use startx. sx uses the dialog tool to present a nice menu where the user can choose: one of up to 10 devices (tablet, joystick, ...) for notebooks, which display to use (internal or external display) which window-manager to use

The small gtk-application xinput-chooser for those who use xdm. xinput-chooser presents the user a menu whenever the xdm login screen is shown, from which one of up to ten different configurations can be chosen.

The concept behind this is that a XF86Config file is split in at least a XF86Config.bare file, which holds the information common to all configurations, and various snippets, each of them holding the special information for a particular configuration.

The two utilities will then concat the parts back to a working configuration.

You can get this packet from , it is named xinput_chooser_sr. XFree FAQ - Problems And Questions

It seems that you have not compiled your gtk with XInput-support. Please rebuild gtk and use ./configure --with-xinput=xfree for building the Makefile. Then do a make && make install. Then rebuild your gimp so that it uses this extendet gtk. Is the wheel of the mouse (cursor) supported ?

Yes, it generates button 4 and button 5 events. How can I find out the intuos Serial Num of my tool ?

read the section about How do I change the action of each button of my tool?

Read the section about . How can I use the intuos/artpad/ultrapad macro area ?

You can not use the intuos macro area, sorry. Only Artpad / Ultrapad Macro stripes work. Read the section about . Is it possible to define multiple active areas on the same tablet ?

Yes, read the section about the Can I use more than one tablet at the same time ?

Yes, read the The Wacom Driver eats my CPU Time. Any Hint ?

This mostly happes under the following condition: AllowMouseOpenFail was specified and the device is set to /dev/null. Set the device to a nonexisting file instead, for example /dev/fake, and you will get back your CPU time. See the examples for this under the .

Another reason may be that there were too many interrupts produced. I was told, that hdparm -u1 /dev/hdx (replace x with your drive letter) may help. The Cursor 'dances' around

Most Graphire's are known to be weak for that, intuos seems to be better but still not perfect. This seems to be a hardware problem. Possible Solutions:

Put your tablet as far as possible away from all emitting devices like monitors, printers, computers, AC-adapters. Use a modified driver with a filter algorythm. Many of them are in development right now but none of them seem to be the cruncher. If using an IDE drive, try hdparm -u1 /dev/hdx (replace x with your drive letter) Gpm FAQ - Problems And Questions

You probably mixed a new gpm with an old gpm library. Or You use an old client which searches the socket gpmctl in /var/run instead in /dev. In the later case you have two options: get new clients and recompile them or change gpm.h so that it uses /var/run instead of /dev and recompile gpm and libgpm.

Further Information / Used Documents

gpm: gpm man page, gpm FAQ, source code file mice.c

XInput: XInput HOWTO by Owen Taylor

XFree and Wacom: XF86Config man page

Frederic Lepied's site

by Arnauld Claden

by Semyon Sosin (intuos related)

much, much, e-mails...