Next Previous Contents

5. Tablets with XFree

5.1 Required XFree Version

Minimum XFree version should be 3.3.3.1 because this version has extended XInput support, the second side switch works now and the blocking mouse effect has been fixed.

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 a very short configuration section and explain then what can be changed and why this is needed.

5.2 Sample XF86Config snippet (simple)

Section "Module"
# Wacom Device Driver
Load "xf86Wacom.so"
EndSection

Section "XInput"
# Settings for Wacom pen
  SubSection "WacomStylus"    # type of input device
    Port "/dev/ttyS0"         # Serial Port
    DeviceName "Pen1"         # Name, choose it free
    Baudrate 9600             # Usable only for intuos
    Mode Absolute             # Map Tablet Area to Screen
    AlwaysCore                # See text
    HistorySize 200           # Buffer size for motion events
  EndSubSection
EndSection

5.3 Section Module

XInput support in XFree is reached due to the use of modules. The device driver module for Wacom is called xf86Wacom.so . This goes to the "Module" section and has to be appear only once per XF86Config file.

5.4 Device Types

A physical device can be:

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 the XF86Config as a subsection in the Section XInput:

5.5 DeviceName

You must give every configured device a unique name. This name will be used later in your program to talk to that device. You can choose this name free.

5.6 Port

XInput wants to know at which serial port this device can be found. This allows me to use two different tablets at the same time, for example a graphire connected to /dev/ttyS0 and a penpartner connected to /dev/ttyS1.

5.7 DebugLevel

This statement controls how verbose the Wacom driver is. The Level goes from 0 to 10. If this statement is not given, DebugLevel 0 is used, which logs the very less.

Example:

SubSection "WacomStylus" # Pen
  DeviceName "PenRed"    # Name, choose it free
  ...
  DebugLevel 10          # be very verbose
  ...
EndSubSection

5.8 Serial Num (intuos series only)

The intuos product is more efficient than penpartner and graphire because it can distinguish many devices of the same type. This means that it is now possible to use two pens, one configured red and one configured blue. As you see, the use of device types is not enough information to handle different pens. Therefore, each intuos device, be it a pen, ink pen, mouse, or whatever has a serial number, which you can specify to aid XInput in resolving the right device. This would look like:

Section "XInput"
  SubSection "WacomStylus" # Pen
    DeviceName "PenRed"    # Name, choose it free
    ...
    Serial 2609917443      # Serial Number of that device
    ...
  EndSubSection
  SubSection "WacomStylus" # another Pen
    DeviceName "PenBlue"   # Name, choose it free
    ...
    Serial 2609918664      # Serial Number of that device
    ...
  EndSubSection
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

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

You should get a list of your different numbers.

Serial Num - Example of what has been logged

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).

5.9 Mode absolute, Mode relative

If you set a device in mode absolute, this means, that the active area of the tablet will be mapped to the screen. Every time you go down to the tablet at the same point with an absolute device the pointer will appear at the same point of the screen.

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:
Mode Absolute

5.10 Device Modes Extension, Core, AlwaysCore

XFree knows two pointers: one with only the standard features (buttons, moving-capabilities), which is used for selecting menus, text, clicking buttons and doing other controlling stuff. This is the Core Device.

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:
AlwaysCore

5.11 HistorySize

This statement sets the buffer size that is used to cache motion events.

5.12 Suppress

This statement specifies how many units the device must move before the driver moves the pointer. This can be necessary if very large resolutions are used.

Example:
Suppress 6

5.13 TiltMode (intuos only)

TiltMode enables sending of tilt information for intuos devices. If this statement is missing, only pressure information is transferred.

5.14 TopX, TopY, BottomX, BottomY Statements

These four statements allow to reduce the active area of the tablet. My intuos A4 oversize, for example, is so big that you can not do painting work with it because the ways of the pen are too long. I use these four Statements to tell the driver that it should map only the lower left quarter of the tablet to the screen.
It is possible to define more than one active area on the same tablet: Define as many subsections as you need with the same Port Statement but with different Top... statements and Devicenames. This results in multiple logical devices all of them restricted to their individual bounds. You may use one device in absolute mode and one in relative mode as well.

Example:

TopX        0 #coord of top left point
TopY     5000
BottomX  5000 #coord of bottom right point
BottomY 10000

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 "X=" 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

5.15 KeepShape

This option uses the TopX, TopY statements (or their built in defaults, if omitted) and adjusts the BottomX, BottomY statements so that

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

5.16 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:

Threshold "5"


Next Previous Contents