Difference between revisions of "Wacom Tablet"

From ArchWiki
Jump to: navigation, search
(Fixed wacom udev rule. Old one sometimes created wrong symlink for my Bamboo pen, and then pen pressure doesn't work.)
(totally restructured and reworked, remove some deprecated stuff, add new sections, especially about button mapping)
Line 2: Line 2:
 
== Introduction ==
 
== Introduction ==
  
Before we begin, I would like to point out that this guide was started for ''USB'' based Wacom tablets, so much of the info in here focuses on that. For an ''internal'' tablet device (like the serial devices found in many Tablet PCs) a static Xorg is recommended in case autodetection does not work. For ''USB'' devices, you can setup both static ''Xorg'' configuration, meaning things may not work if later on you plug your Wacom tablet into a different ''USB'' port, or follow the dynamic instructions further down.
+
Before we begin, I would like to point out that this guide was started for ''USB'' based Wacom tablets, so much of the info in here focuses on that. Usually it's recommended to rely on ''Xorg's'' auto-detection or to use a '''dynamic''' setup.
 +
However for an ''internal'' tablet device one might consider a '''static''' Xorg setup in case autodetection does not work.
 +
A static ''Xorg'' setup is usually not able to recognize your Wacom tablet when it's connected to a different ''USB'' port or even after unplugging and replugging it into the same port, and as such it should be considered as deprecated.
  
 
It is also worth to mention that this wiki article is very much influenced by the very helpful [http://en.gentoo-wiki.com/wiki/HOWTO_Wacom_Tablet Gentoo Linux Wiki - HOWTO Wacom Tablet], which I recommend anyone visit if they would like to learn about things that are not covered here.
 
It is also worth to mention that this wiki article is very much influenced by the very helpful [http://en.gentoo-wiki.com/wiki/HOWTO_Wacom_Tablet Gentoo Linux Wiki - HOWTO Wacom Tablet], which I recommend anyone visit if they would like to learn about things that are not covered here.
  
=== Try Autodetection First ===
+
== Installing ==
  
Newer versions of X might be able to automatically detect and configure your device. Before going any further, try installing the xf86-input-wacom package, reboot your system, and (re-)start X. With the arrival of Xorg 1.8 that dropped support for [[HAL]] in favor of udev, auto-detection might be broken for some tablets as fitting udev rules might not exist yet, so you need to write your own.
+
=== Check if kernel drivers needed (usually not) ===
  
If you have linuxwacom or linuxwacom-dev and X fails to start, remove those packages first. They are known to cause problems with newer version of X. xf86-input-wacom is the only package you need to install the X11 drivers.
+
After plugging in the tablet (in case of a USB device) check {{ic|lsusb}} and/or {{ic|dmesg | grep -i wacom}} to see if the kernel recognizes your tablet. It should also be listed in {{ic|/proc/bus/input/devices}}.
  
Test if your device was recognized completely (i.e., that both pen and eraser work, if applicable), by issuing command
+
In case it's not recognized, which might happen for new devices not supported by current kernel, it is also possible to install git version of kernel driver from: stable branch ({{AUR|wacom-linux-git}}), next branch ({{AUR|wacom-next-linux-git}}) or mainline branch ({{AUR|wacom-mainline-linux-git}}).
  
   xsetwacom --list devices
+
=== Install Wacom drivers ===
 +
 
 +
Thanks to [http://linuxwacom.sourceforge.net The Linux Wacom Project], you only need to install the {{Pkg|xf86-input-wacom}} package, which contains everything needed to use a Wacom tablet on Linux.
 +
 
 +
   # pacman -S xf86-input-wacom
 +
 
 +
{{Note|There is also {{AUR|xf86-input-wacom-git}} in AUR which provides git version of ''xf86-input-wacom'', but you might encounter some troubles. For me the buttons for example did only work with the stable release, not with the git version. So it's recommended to try ''xf86-input-wacom'' irst.}}
 +
 
 +
 
 +
=== Automatical setup ===
 +
 
 +
Newer versions of X should be able to automatically detect and configure your device. Before going any further, reboot your system and (re-)start X. Test if your device was recognized completely (i.e., that both pen and eraser work, if applicable), by issuing command
 +
 
 +
  $ xsetwacom --list devices
  
 
which should detect all devices with type, for example
 
which should detect all devices with type, for example
Line 23: Line 38:
 
   Wacom Bamboo 2FG 4x5 Finger pad id: 14 type: PAD       
 
   Wacom Bamboo 2FG 4x5 Finger pad id: 14 type: PAD       
  
You can also test it by opening gimp or xournal and checking the extended input devices section, or whatever tablet-related configuration is supported by the software of your choice.
+
You can also test it by opening {{Pkg|Gimp}} or {{Pkg|Xournal}} and checking the extended input devices section, or whatever tablet-related configuration is supported by the software of your choice.
  
== Installing ==
+
For this to work you don't need any {{ic|xorg.conf}} file, any configurations are made in files in the {{ic|/etc/X11/xorg.conf.d/}} folder.
 +
If everything is working you can skip the manual configuration and '''proceed''' to the configuration section to learn how to further customize your tablet.
  
=== Install Wacom drivers ===
+
With the arrival of Xorg 1.8 support for [[HAL]] was dropped in favor of udev which might break auto-detection for some tablets as fitting udev rules might not exist yet, so you may need to write your own.
  
Thanks to [http://linuxwacom.sourceforge.net The Linux Wacom Project], you only need to install the ''xf86-input-wacom'' package, which contains everything needed to use a Wacom tablet on Linux. There is also {{AUR|xf86-input-wacom-git}} in AUR which provides git version of ''xf86-input-wacom''. In case of new devices not supported by current kernel, it is also possible to install git version of kernel driver from: stable branch ({{AUR|wacom-linux-git}}), next branch ({{AUR|wacom-next-linux-git}}) or mainline branch ({{AUR|wacom-mainline-linux-git}}).
+
If you have {{Pkg|linuxwacom}} or {{Pkg|linuxwacom-dev}} remove those packages first. They are known to cause problems with newer version of X. ''xf86-input-wacom'' is the only package you need to install the X11 drivers.
  
===Dynamic Xorg setup with udev===
 
Again thanks to [http://gentoo-wiki.com/HOWTO_Wacom_Tablet Gentoo Linux Wiki - HOWTO Wacom Tablet] for the information! This was done with a ''Volito2'', and so reflects the experiences with that tablet, but it should work for any tablet supported by the linuxwacom project.
 
  
 +
=== Manual setup ===
 +
A manual configuration is done in {{ic|/etc/X11/xorg.conf}} or in a separate file in the {{ic|/etc/X11/xorg.conf.d/}} directory.
 +
The Wacom tablet device is accessed using a input event interface in {{ic|/dev/input/}} which is provided by the kernel driver.
 +
The interface number {{ic|event??}} is likely to change when unplugging and replugging into the same or especially a different ''USB'' port.
 +
Therefore it's wise to don't refer to the device using it's concrete {{ic|event??}} interface ('''static''' configuration) but by letting ''udev'' dynamically create a symbolic link to the correct {{ic|event}} file ('''dynamic''' configuration).
 +
 +
====Dynamic with udev====
 
{{Note|In AUR there is wacom-udev package, which includes udev-rules-file. You might skip this part and move on to the {{ic|xorg.conf}} configuration if you are using the wacom-udev package from AUR.}}
 
{{Note|In AUR there is wacom-udev package, which includes udev-rules-file. You might skip this part and move on to the {{ic|xorg.conf}} configuration if you are using the wacom-udev package from AUR.}}
  
Install ''udev'' from the repositories (when using Xorg > 1.8, this is a dependency and will already be installed).
+
Assuming ''udev'' is already installed you simply need to install {{AUR|wacom-udev}} from AUR, e.g. by using
Run the ''lsusb'' command. It should return something like this
+
  $ yaourt -S wacom-udev
  
Bus 002 Device 007: ID 056a:0062 Wacom Co., Ltd
+
=====USB-devices=====
Bus 002 Device 006: ID 03eb:0902 Atmel Corp.
+
After (re-)plugging in your ''USB''-tablet (or at least after rebooting) some symbolic links should appear in {{ic|/dev/input}} refering to your tablet device.
Bus 002 Device 005: ID 0bc2:0503 Seagate RSS LLC
+
Bus 002 Device 004: ID 05e3:0660 Genesys Logic, Inc. USB 2.0 Hub
+
Bus 002 Device 001: ID 1d6b:0002
+
Bus 003 Device 001: ID 1d6b:0001
+
Bus 001 Device 003: ID 06a3:8000 Saitek PLC
+
Bus 001 Device 002: ID 045e:00d1 Microsoft Corp.
+
Bus 001 Device 001: ID 1d6b:0001
+
You can see from here my tablet among other devices. We are interested in the tablet and mouse - unless there is no usb mouse attached to the said computer of course.
+
Next make two udev rules files in ''/etc/udev/rules.d''.
+
File {{ic|10-local.rules}} for mouse rule, you need to add this line
+
  
KERNEL=="mouse*", ATTRS{idProduct}=="045e", NAME="input/%k", SYMLINK="input/mouse_udev"
+
  $ ls /dev/input/wacom*  
 +
  /dev/input/wacom  /dev/input/wacom-stylus  /dev/input/wacom-touch
  
File {{ic|60-wacom.rules }} for wacom rule (taken from linuxwacom wiki, [http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Fixed_device_files_with_udev Fixed device files with udev]):
+
If not, your device is likely to be not yet included in the ''udev'' configuration from ''wacom-udev'' which resides in {{ic|/usr/lib/udev/rules.d/10-wacom.rules}}. It's a good idea to copy the file e.g. to {{ic|10-my-wacom.rules}} before modifiing it, else it might be reverted by a package upgrade.
  
  # udev rules for wacom tablets.
+
Add your device to the file by duplicating some line of another device and adapting ''idVendor'',''idProduct'' and the symlink name to your device.
 
+
The two id's can by determined using
  KERNEL!="event[0-9]*", GOTO="wacom_end"
+
 
 
+
$ lsusb | grep -i wacom
  # Multiple interface support for stylus and touch devices.
+
Bus 002 Device 007: ID 056a:0062 Wacom Co., Ltd
  DRIVERS=="wacom", ATTRS{bInterfaceNumber}=="00", ENV{WACOM_TYPE}="stylus"
+
 
  DRIVERS=="wacom", ATTRS{bInterfaceNumber}=="01", ENV{WACOM_TYPE}="touch"
+
In this example idVendor is 056a and idProduct 0062.
 
+
In case you have device with touch (e.g. Bamboo Pen&Touch) you might need to add a second line for the touch input interface.
  # Convenience links for the common case of a single tablet.  We could do just this:
+
For details check the linuxwacom wiki [http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Fixed_device_files_with_udev Fixed device files with udev].
  #ATTRS{idVendor}=="056a", SYMLINK+="input/wacom-$env{WACOM_TYPE}"
+
  # but for legacy reasons, we keep the input/wacom link as the generic stylus device.
+
  ATTRS{idVendor}=="056a", ENV{WACOM_TYPE}!="touch", SYMLINK+="input/wacom"
+
  ATTRS{idVendor}=="056a", ENV{WACOM_TYPE}=="touch", SYMLINK+="input/wacom-touch"
+
 
+
  # Check and repossess the device if a module other than the wacom one
+
  # is already bound to it.
+
  ATTRS{idVendor}=="056a", ACTION=="add", RUN+="check_driver wacom $devpath $env{ID_BUS}"
+
 
+
  LABEL="wacom_end"
+
  
Of course you need to change '056a' and '045e' to what lsusb returns for you – I used the VendorID for my tablet and the ProductID for my mouse.
 
 
Save the file and reload udev's configuration profile using the command ''udevadm control --reload-rules''
 
Save the file and reload udev's configuration profile using the command ''udevadm control --reload-rules''
Check to make sure that it has appeared in ''/dev/input''. Note that you may need to plug-in the tablet again for the device to appear.
+
Check again the content of ''/dev/input'' to make sure that the ''wacom'' symlinks appeared.
 +
Note that you may need to plug-in the tablet again for the device to appear.
 +
 
 +
The files of further interest for the ''Xorg'' configuration are {{ic|/dev/input/wacom}} and for a touch-device also {{ic|/dev/input/wacom_touch}}.
 +
 
 +
=====Serial devices=====
 +
The {{AUR|wacom-udev}} should also include support for serial devices. Users of serial tablets might be also interested in the inputattach tool from {{AUR|linuxconsole}} package. The inputattach command allows to bind serial device into /dev/input tree, for example with:
 +
 
 +
  # inputattach --w8001 /dev/ttyS0
 +
 
 +
See ''man inputattach'' for help about available options.
 +
As for USB devices one should end up with a file {{ic|/dev/input/wacom}} and proceed with the ''Xorg'' configuration.
 +
 
 +
====Static setup====
 +
If you insist in using a static setup just refer to your tablet in the ''Xorg'' configuration in the next section using the correct {{ic|/dev/input/event??}} files as one can find out by looking into {{ic|/proc/bus/input/devices}}.
 +
 
 +
====Xorg configuration====
  
bash-3.2# cd /dev/input
+
In either case, dynamic or static setup you got now one or two files in {{ic|/dev/input/}} which refer to the correct input event devices of your tablet. All that is left to do is add the relevent information to {{ic|/etc/X11/xorg.conf}}, or a dedicated file under {{ic|/etc/X11/xorg.conf.d/}}.
  bash-3.2# ls
+
The exact configuration depends on your tablet's features of course. {{ic|xsetwacom --list devices}} might give helpful informations on what ''InputDevice'' sections are needed for your tablet.
by-id    event0  event2  event4  event6  event8  mouse0  mouse2      wacom
+
by-path  event1  event3  event5  event7  mice    mouse1  mouse_udev
+
You can even check that the device works by
+
  
# cat wacom
+
An example configuration for a ''Volito2'' might look like this
It should make lots of odd characters appear onscreen.
+
If it works, then all that is left to do is add the relevent information to {{ic|/etc/X11/xorg.conf}}.
+
  
 
  Section "InputDevice"
 
  Section "InputDevice"
 
     Driver        "wacom"
 
     Driver        "wacom"
 
     Identifier    "stylus"
 
     Identifier    "stylus"
     Option        "Device"      "/dev/input/wacom"
+
     Option        "Device"      "/dev/input/wacom"   # or the corresponding event?? for a static setup
 
     Option        "Type"        "stylus"
 
     Option        "Type"        "stylus"
 
     Option        "USB"          "on"                # USB ONLY
 
     Option        "USB"          "on"                # USB ONLY
Line 104: Line 116:
 
     Driver        "wacom"
 
     Driver        "wacom"
 
     Identifier    "eraser"
 
     Identifier    "eraser"
     Option        "Device"      "/dev/input/wacom"
+
     Option        "Device"      "/dev/input/wacom"   # or the corresponding event?? for a static setup
 
     Option        "Type"        "eraser"
 
     Option        "Type"        "eraser"
 
     Option        "USB"          "on"                  # USB ONLY
 
     Option        "USB"          "on"                  # USB ONLY
Line 115: Line 127:
 
     Driver        "wacom"
 
     Driver        "wacom"
 
     Identifier    "cursor"
 
     Identifier    "cursor"
     Option        "Device"      "/dev/input/wacom"
+
     Option        "Device"      "/dev/input/wacom"   # or the corresponding event?? for a static setup
 
     Option        "Type"        "cursor"
 
     Option        "Type"        "cursor"
 
     Option        "USB"          "on"                  # USB ONLY
 
     Option        "USB"          "on"                  # USB ONLY
Line 121: Line 133:
 
     Option        "Vendor"      "WACOM"
 
     Option        "Vendor"      "WACOM"
 
  EndSection
 
  EndSection
 +
 
Make sure that you also change the path ({{Ic|"Device"}}) to your mouse, as it will be {{Ic|/dev/input/mouse_udev}} now.
 
Make sure that you also change the path ({{Ic|"Device"}}) to your mouse, as it will be {{Ic|/dev/input/mouse_udev}} now.
  
Line 145: Line 158:
 
  InputDevice    "Mouse1" "CorePointer"
 
  InputDevice    "Mouse1" "CorePointer"
  
====Tablet PC with serial Wacom tablet device (Xorg > 1.8)====
+
== Configuration ==
Create /etc/udev/rules.d/10-wacom.rules with these lines:
+
  
ACTION!="add|change", GOTO="wacom_end"
+
=== General concepts ===
    # Match all wacom tablets with a serial ID starting with WACf or FUJ*
+
    ATTRS{id}=="WACf*" ENV{NAME}="Serial Wacom Tablet", ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
+
    ATTRS{id}=="FUJ*" ENV{NAME}="Serial Wacom Tablet", ENV{ID_INPUT}="1", ENV{ID_INPUT_TABLET}="1"
+
LABEL="wacom_end"
+
  
the lines are included in {{AUR|wacom-udev}} package. Users of serial tablets might be also interested in the inputattach tool from {{AUR|linuxconsole}} package. The inputattach command allows to bind serial device into /dev/input tree, for example with:
+
The configuration can be done in two ways temporary using the `xsetwacom` tool, which is included in ''xf86-input-wacom'' or permanent in {{ic|xorg.conf}} or better in a extra file in {{ic|/etc/X11/xorg.conf.d}}.
 +
The possible options are identical so it's recommended to first use `xsetwacom` for testing and later add the final config to the ''Xorg'' configuration files.
  
  inputattach --w8001 /dev/ttyS0
+
==== Temporary configuration ====
  
See ''man inputattach'' for help about available options.
+
For the beginning it's a good idea to inspect the default configuration and all possible options using the following commands.
 +
 
 +
  $ xsetwacom --list devices                    # list the available devices for the get/set commands
 +
  Wacom Bamboo 16FG 4x5 Finger touch id: 12 type: TOUCH
 +
  Wacom Bamboo 16FG 4x5 Finger pad id: 13 type: PAD     
 +
  Wacom Bamboo 16FG 4x5 Pen stylus id: 17 type: STYLUS   
 +
  Wacom Bamboo 16FG 4x5 Pen eraser id: 18 type: ERASER
 +
  $ xsetwacom --get "Wacom Bamboo 16FG 4x5" all # using the device name
 +
  $ xsetwacom --get 17 all                      # or equivalently use the device id
 +
  $ xsetwacom --list parameters                # to get an explanation of the Options
 +
  $ man wacom                                  # get even more details
 +
 
 +
'''Caution''', don't use the device id when writing shell scripts to set some options as the ids might change after an hotplug.
 +
 
 +
Options can be changed with the {{ic|--set}} flag. Some useful examples are
 +
 
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" ScrollDistance 50  # change scrolling speed
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" Gesture off        # disable multitouch gestures
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" Touch off          # disable touch
 +
 
 +
For further configuration tips and tricks see below in [[#Specific configuration tips]].
 +
{{Note|You can reset your temporary configuration at any time by unplugging and replugging in your tablet.}}
 +
 
 +
==== Permanent configuration ====
 +
 
 +
To make a permanent configuration the preferred way for ''Xorg''>1.8 is to create a new file in {{ic|/etc/X11/xorg.conf.d}}
 +
e.g. {{ic|52-wacom-options.conf}} with the following content.
 +
 
 +
{{hc|/etc/X11/xorg.conf.d/52-wacom-options.conf|
 +
Section "InputClass"
 +
    Identifier "Wacom Bamboo stylus options"
 +
    MatchDriver "wacom"
 +
    MatchProduct "Pen"
 +
   
 +
    # Apply custom Options to this device below.
 +
    Option "Rotate" "none"
 +
    Option "RawSample" "20"
 +
    Option "PressCurve" "0,10,90,100"
 +
EndSection
 +
 
 +
Section "InputClass"
 +
    Identifier "Wacom Bamboo eraser options"
 +
    MatchDriver "wacom"
 +
    MatchProduct "eraser"
 +
   
 +
    # Apply custom Options to this device below.
 +
    Option "Rotate" "none"
 +
    Option "RawSample" "20"
 +
    Option "PressCurve" "5,0,100,95"
 +
EndSection
 +
 
 +
Section "InputClass"
 +
    Identifier "Wacom Bamboo touch options"
 +
    MatchDriver "wacom"
 +
    MatchProduct "Finger"
 +
   
 +
    # Apply custom Options to this device below.
 +
    Option "Rotate" "none"
 +
    Option "ScrollDistance" "18"
 +
    Option "TapTime" "220"
 +
EndSection
 +
 
 +
Section "InputClass"
 +
    Identifier "Wacom Bamboo pad options"
 +
    MatchDriver "wacom"
 +
    MatchProduct "pad"
 +
   
 +
    # Apply custom Options to this device below.
 +
    Option "Rotate" "none"
 +
   
 +
    # Setting up buttons
 +
    Option "Button1" "1"
 +
    Option "Button2" "2"
 +
    Option "Button3" "3"
 +
    Option "Button4" "0"
 +
EndSection
 +
}}
 +
 
 +
The identifiers can be set arbitrarily. The option names are (except for the buttons) identical to the ones listed by {{ic|xsetwacom --list parameters}} and especially also in {{ic|man wacom}}. As noted in [[#Remapping Buttons]] the button ids seem to be different than the ones for {{ic|xsetwacom}}.
 +
 
 +
=== Specific configuration tips ===
 +
 
 +
Check out the [[http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Linuxwacom_HOWTO Howto section]] in the Linuxwacom wiki.
 +
 
 +
==== Changing orientation ====
 +
 
 +
If you want to use your tablet in a different orientation you have to tell this to the driver, else the movements don't cause the expected results.
 +
This is done by setting the '''Rotate''' option for all devices. Possible orientations are '''none''','''cw''','''ccw''' and '''half'''.
 +
A quick way is e.g.
 +
  $ for i in 12 13 17 18; do xsetwacom --set $i Rotate half; done  # remember the ids might change when hotplugging
 +
 
 +
or use the following script like this {{ic|./wacomrot.sh half}}
 +
 
 +
{{hc|1=wacomrot.sh|2=
 +
#!/bin/bash
 +
device="Wacom Bamboo 16FG 4x5"
 +
stylus="$device Pen stylus"
 +
eraser="$device Pen eraser"
 +
touch="$device Finger touch"
 +
pad="$device Finger pad"
 +
 
 +
xsetwacom --set "$stylus" Rotate $1
 +
xsetwacom --set "$eraser" Rotate $1
 +
xsetwacom --set "$touch"  Rotate $1
 +
xsetwacom --set "$pad"    Rotate $1
 +
}}
 +
 
 +
==== Remapping Buttons ====
 +
 
 +
It's possible to remap the buttons with hotkeys.
 +
 
 +
===== Finding out the button IDs =====
 +
Sometimes it needs some trial&error to find the correct button IDs. For me they even differ for {{ic|xsetwacom}} and the {{ic|xorg.conf}} configuration. Very helpful tools are {{ic|xev}} or {{ic|xbindkeys -mk}}. An easy way to proceed is the following
 +
 
 +
  $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 1
 +
  $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 2 2
 +
  $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 3 3
 +
  $ # and so on
 +
 
 +
Then fire up {{ic|xev}} from a terminal window, place your mouse cursor above the window and hit the buttons and write down the ids.
 +
 
 +
===== The syntax =====
 +
 
 +
The syntax of {{ic|xsetwacom}} is flexible but not very well documented. The general mapping syntax (extracted from the source code) for xsetwacom 0.17.0 is the following.
 +
 
 +
  KEYWORD [ARGS...] [KEYWORD [ARGS...] ...]
 +
 
 +
  KEYWORD + ARGS:
 +
    key [+,-]KEY [[+,-]KEY ...]  where +:key down, -:key up, no prefix:down and up
 +
    button BUTTON [BUTTON ...]  (1=left,2=middle,3=right mouse button, 4/5 scroll mouse wheel)
 +
    modetoggle                  toggle absolute/relative tablet mode
 +
    displaytoggle                toggle cursor movement among all displays which include individual screens
 +
                                plus the whole desktop for the selected tool if it is not a pad.
 +
                                When the tool is a pad, the function applies to all tools that are asssociated
 +
                                with the tablet
 +
 
 +
  BUTTON: button ID as integer number
 +
 
 +
  KEY: MODIFIER, SPECIALKEY or ASCIIKEY
 +
  MODIFIER: (each can be prefix with an '''l''' or an '''r''' for the left/right modifier (no prefix = left)
 +
    ctrl=ctl=control, meta, alt, shift, super, hyper
 +
  SPECIALKEY: f1-f35, esc=Esc, up,down,left,right, backspace=Backspace, tab, PgUp,PgDn
 +
  ASCIIKEY: (usual characters the key produces, e.g. a,b,c,1,2,3 etc.)
 +
 
 +
===== Some examples =====
 +
 
 +
  $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 3 # right mouse button
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +ctrl z -ctrl"
 +
  $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 1
 +
  key +Control_L +z -z -Control_L
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +shift button 1 key -shift"
 +
 
 +
even little macros are possible
 +
 
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +shift h -shift e l l o"
 +
 
 +
{{Note|There seems to be a bug in the ''xf86-input-wacom'' driver version 0.17.0, at least for my ''Wacom Bamboo Pen & Touch'', but I guess this holds in general. It causes the keystrokes not to be overwritten correctly.
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key a b c" # press button 1 -> abc
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key d"    # press button 1 -> dbc  WRONG!
 +
 
 +
A simple workaround is to reset the mapping by mapping to "":
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 ""          # to reset the mapping
 +
  $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key d"    # press button 1 -> d
 +
 
 +
}}
 +
 
 +
===== Execute custom commands =====
 +
 
 +
Mapping custom commands to the buttons is a little bit tricky but actually very simple. You'll need {{Pkg|xbindkeys}} so install it using
 +
  # pacman -S xbindkeys
 +
 
 +
To get well defined button codes add the following to your permanent configuration file, e.g. {{ic|/etc/X11/xorg.conf.d/52-wacom-options.conf}}
 +
in the InputClass section of your '''pad''' device. Map the tablet's buttons to some unused button ids.
 +
 
 +
  # Setting up buttons (preferably choose the correct button order, so the topmost key is mapped to 10 and so on)
 +
  Option "Button1" "10"
 +
  Option "Button2" "11"
 +
  Option "Button3" "12"
 +
  Option "Button4" "13"
 +
 
 +
Then restart your ''Xorg'' server and verify the buttons using {{ic|xev}} or {{ic|xbindkeys -mk}}.
 +
 
 +
Now set up your xbindkeys configuration, if you don't already have one you might want to create a default configuration
 +
  $ xbindkeys --defaults > ~/.xbindkeysrc
 +
 
 +
Then add your custom key mapping to {{ic|~/.xbindkeysrc}}, for example
 +
 
 +
  "firefox"
 +
      m:0x10 + b:10  (mouse)
 +
  "xterm"
 +
      m:0x10 + b:11  (mouse)
 +
  "xdotool key ctrl-z"
 +
      m:0x10 + b:12  (mouse)
 +
  "send-notify Test "No need for escaping the quotes""
 +
      m:0x10 + b:13  (mouse)
 +
 
 +
===== Application specific hotkeys =====
 +
 
 +
This is quite tricky as the usual tools don't allow application specific hotkeys.
 +
However I found the idea quite appealing to use the buttons for different thinks depending on the application.
 +
 
 +
To make this possible I use a python script which uses {{Pkg|xorg-xprop}}, {{Pkg|xdotools}} and the custom commands setup from the last section, which depends on {{Pkg|xbindkeys}}.
 +
 
 +
Change the mappings in {{ic|~/.xbindkeysrc}}
 +
 
 +
  "appkey 1"
 +
      m:0x10 + b:10  (mouse)
 +
  "appkey 2"
 +
      m:0x10 + b:11  (mouse)
 +
  "appkey 3"
 +
      m:0x10 + b:12  (mouse)
 +
  "appkey 4"
 +
      m:0x10 + b:13  (mouse)
 +
 
 +
And copy the following script to a file named {{ic|appkey}} somewhere in your path ({{ic|$PATH}}) and make it executable using
 +
  chmod 755 /usr/local/bin/appkey
 +
 
 +
{{hc|1=/usr/local/bin/appkey|2=
 +
#!/usr/bin/python
 +
# written in 2012 by buergi
 +
# this script is public domain, no rights reserved, CC0
 +
# do with it whatever you want
 +
 
 +
import sys
 +
from subprocess import Popen,PIPE
 +
 
 +
def get_active_window_class(sep=':'):
 +
    p = Popen(['xdotool', 'getactivewindow'], stdout=PIPE)
 +
    winid  = p.communicate()[0]
 +
    p = Popen(['xprop', '-id', winid, 'WM_CLASS'], stdout=PIPE)
 +
 
 +
    try:
 +
        out = p.communicate()[0].decode('ascii')
 +
    except UnicodeDecodeError as e:
 +
        return ''
 +
 
 +
    try:
 +
        tmp = out.split(' = ',1)[1]
 +
        winclass = sep.join(tmp.split('", "'))[1:-2]
 +
    except IndexError as e:
 +
        return ''
 +
 
 +
    return winclass
 +
 
 +
def send_key(keystroke):
 +
    Popen(['xdotool', 'key', keystroke])
 +
 
 +
def main(argc,argv):
 +
    key=0
 +
    if argc==2:
 +
        key=argv[1]
 +
    else:
 +
        print("Usage: %s KEY"%argv[0])
 +
 
 +
    cls = get_active_window_class()
 +
    if 'Firefox' in cls: # my configuration for Pentadactyl
 +
        if key=='1':
 +
            send_key('shift+h')
 +
        if key=='2':
 +
            send_key('shift+l')
 +
        if key=='3':
 +
            send_key('Escape')
 +
            send_key('r')
 +
    if 'Inkscape' in cls:
 +
        if key=='1':
 +
            send_key('F1')
 +
        if key=='2':
 +
            send_key('F2')
 +
        if key=='3':
 +
            send_key('ctrl+F6')
 +
    if key=='4':
 +
        # toggle finger touch
 +
        p=Popen(['xsetwacom','--get','Wacom Bamboo 16FG 4x5 Finger touch','Touch'],stdout=PIPE)
 +
        stat  = p.communicate()[0].decode('ascii').strip()
 +
        istat = 'on' if 'off' in stat else 'off'
 +
        Popen(['xsetwacom','--set','Wacom Bamboo 16FG 4x5 Finger touch','Touch',istat])
 +
    return 0
 +
 
 +
if __name__ == '__main__':
 +
    main(len(sys.argv),sys.argv)
 +
}}
 +
 
 +
 
 +
==== TwinView Setup ====
 +
 
 +
If you are going to use two Monitors the aspect ratio while using the Tablet might feel unnatural. In order to fix this you need to add
 +
 
 +
Option "TwinView" "horizontal"
 +
 
 +
To all of your Wacom-InputDevice entries in the {{ic|xorg.conf}} file.
 +
You may read more about that [http://ubuntuforums.org/showthread.php?t=640898 HERE]
 +
 
 +
==== Xrandr Setup ====
 +
xrandr sets two monitors as one big screen, mapping the tablet to the whole virtual screen and deforming aspect ratio.
 +
For a solution see this thread: [https://bbs.archlinux.org/viewtopic.php?pid=797617 archlinux forum].
 +
 
 +
If you just want to map the tablet to one of your screens, first find out what the screens are called
 +
$ xrandr
 +
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
 +
'''HDMI-0''' disconnected (normal left inverted right x axis y axis)
 +
'''DVI-0''' connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
 +
  1920x1080      60.0*+
 +
  1680x1050      60.0 
 +
  ...
 +
'''VGA-0''' connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm
 +
  1920x1080      60.0*+
 +
  1680x1050      60.0 
 +
  ...
 +
Then you need to know what is the ID of your tablet.
 +
$ xsetwacom --list devices
 +
WALTOP International Corp. Slim Tablet stylus  id: '''12'''  type: STYLUS
 +
 
 +
In my case I want to map the tablet (ID: '''12''') to the screen on the right, which is '''"VGA-0"'''. I can do that with this command
 +
$ xsetwacom --set '''12''' MapToOutput '''"VGA-0"'''
 +
This should immediately work, no root necessary.
 +
 
 +
If xsetwacom replies with "Unable to find an output ..." an X11 geometry string of the form '''WIDTHxHEIGHT+X+Y''' can be specified instead of the screen identifier. In this example
 +
$ xsetwacom --set '''12''' MapToOutput '''"1920x1080+1920+0"'''
 +
should also map the tablet to the screen on the right.
 +
 
 +
=== Pressure curves ===
 +
 
 +
You can add two options to xorg.conf to change how the pressure is registered when putting pressure on the pen. Example:
 +
 
 +
  Option        "PressCurve"    "50,0,100,50"        # Custom preference
 +
  Option        "Threshold"    "60"                  # sensitivity to do a "click"
 +
 
 +
== Application-specific configuration ==
 +
 
 +
=== The GIMP ===
 +
 
 +
To enabled proper usage, and pressure sensitive painting in [http://www.gimp.org The GIMP], just go to ''Preferences → Input Devices → Configure Extended Input Devices...''. Now for each of your ''eraser'', ''stylus'', and ''cursor'' '''devices''', set the '''mode''' to ''Screen'', and remember to save.
 +
 
 +
*Please take note that if present, the ''pad'' '''device''' should be kept disabled as I do not think The GIMP supports such things. Alternatively, to use such features of your tablet you should map them to keyboard commands with a program such as [http://hem.bredband.net/devel/wacom/ Wacom ExpressKeys].
 +
 
 +
*You should also take note that the tool selected for the ''stylus'' is independent to that of the ''eraser''. This can actually be quite handy, as you can have the ''eraser'' set to be used as any tool you like.
 +
 
 +
For more information checkout the ''Setting up GIMP'' section of [http://www.gimptalk.com/forum/topic.php?t=17992&start=1 GIMP Talk - Community - Install Guide: Getting Wacom Drawing Tablets To Work In Gimp].
 +
 
 +
=== Inkscape ===
 +
 
 +
As in The GIMP, to do the same simply got to ''File → Input Devices...''. Now for each of your ''eraser'', ''stylus'', and ''cursor'' '''devices''', set the '''mode''' to ''Screen'', and remember to save.
 +
 
 +
=== Krita ===
 +
 +
Krita 2.0 and later only require that QT is able to use your tablet to function properly. If your tablet is not working in Krita, then make sure to check it is working in QT first. The effect of tablet pressure can then be tweaked in the painttop configuration, for example by selecting opacity, then selecting pressure from the drop down and adjusting the curve to your preference.
 +
 
 +
For earlier versions of Krita, simply go to ''Settings → Configure Krita...'' Click on ''Tablet'' and then like in Inkscape and GIMP set ''stylus'' and any others' mode to screen.
 +
 
 +
=== VirtualBox ===
 +
 
 +
''My current setup is :
 +
  Guest OS: Windows XP
 +
  Tablet: Wacom Graphire4
 +
  Linux Driver: xf86-input-wacom 0.8.4-1''
 +
 
 +
First, make sure that your tablet works well under Arch. Then, download and install the last driver from [http://www.wacom.com/downloads/drivers.php Wacom website] on the guest OS. Shutdown the virtual machine, go to '''Settings > USB'''. Select '''Add Filter From Device''' and select your tablet (e.g. WACOM CTE-440-U V4.0-3 [0403]). Select '''Edit Filter''', and change the last item '''Remote''' to '''Any'''.
 +
 
 +
 
 +
==Newer tablets & Troubleshooting==
 +
 
 +
Newer tablets's drivers might not be in the kernel yet, and additional manipulations might be needed.
 +
For example, for the Wacom Bamboo Connect CTL-470/k and Pen & Touch CTH670, follow the instructions in [https://bbs.archlinux.org/viewtopic.php?id=131831 this thread].
 +
'''There seems to be a problem with the CTH670 that is fixed in the attachment found in [http://www.mail-archive.com/linuxwacom-devel@lists.sourceforge.net/msg03922.html this post]'''
 +
To compile it use the same instructions as in [https://bbs.archlinux.org/viewtopic.php?id=131831 this thread]
 +
 
 +
 
 +
==Dynamic Xorg setup with HAL (deprecated)==
 +
{{Out of date|HAL support was dropped in Xorg 1.8 which entered the repos in June 2010, it should not be used anymore}}
  
===Dynamic Xorg setup with HAL===
 
  
 
{{Note | In Xorg 1.8 and later, support for HAL is dropped. Input hotplugging will ''NOT'' work with these versions of X, you need to use udev (see above) instead. }}
 
{{Note | In Xorg 1.8 and later, support for HAL is dropped. Input hotplugging will ''NOT'' work with these versions of X, you need to use udev (see above) instead. }}
Line 242: Line 618:
 
  </deviceinfo>
 
  </deviceinfo>
  
==== Calibrating Tablet ====
+
=== HAL tablet calibration fix ===
  
 
In order for calibration to work even when the screen is rotated (this applies for both serial and USB tablets), the wacom-names script is useful. It renames your X input devices so that they can be recognized by the linuxwacom driver. Download it from [http://ubuntuforums.org/attachment.php?attachmentid=109824&d=1239742307 here]. You need to be a Ubuntu forums member to download it. If you are not, here is the script. Remember, it was originally intended for Ubuntu so the instructions do not all apply to us Archers:
 
In order for calibration to work even when the screen is rotated (this applies for both serial and USB tablets), the wacom-names script is useful. It renames your X input devices so that they can be recognized by the linuxwacom driver. Download it from [http://ubuntuforums.org/attachment.php?attachmentid=109824&d=1239742307 here]. You need to be a Ubuntu forums member to download it. If you are not, here is the script. Remember, it was originally intended for Ubuntu so the instructions do not all apply to us Archers:
Line 290: Line 666:
 
If you are looking for more information, this [http://ubuntuforums.org/showthread.php?t=1038949 thread] at the Ubuntu forums is incredibly useful, and also provided the link to Rec's wacom-names script.
 
If you are looking for more information, this [http://ubuntuforums.org/showthread.php?t=1038949 thread] at the Ubuntu forums is incredibly useful, and also provided the link to Rec's wacom-names script.
  
=== Static Xorg config ===
 
{{Note | Static configuration is deprecated by the X.org project. If you are using a version of Xorg 1.8 or newer, try configuring with udev (see above) first. If you are using a using Xorg older than 1.8, consider using HAL (see above) instead. These approaches will give you the ability for hotplugging and automatic configuration.}}
 
  
This is a static ''Xorg'' configuration, meaning things may not work if later on you plug your Wacom tablet into a different USB port.
 
 
InputDevice    "cursor" "SendCoreEvents"
 
InputDevice    "stylus" "SendCoreEvents"
 
InputDevice    "eraser" "SendCoreEvents"
 
Firstly, add these to the ''ServerLayout'' section of your ''Xorg'' config ({{ic|/etc/X11/xorg.conf}}).
 
 
$ cat /proc/bus/input/devices
 
Now we need to determine the location of your tablet ''device''. Run the command above, and take note of the ''event'' number of the ''Handlers'' row. We will use this to set the correct device in our ''Xorg'' config below. If you are using a serial tablet, chances are that there will not be any such device displayed here. Try
 
$ cat /dev/ttyS0
 
 
and move the pen on the tablet. If pen movement makes garbage characters show up on screen, this is your tablet device. In this case, use this as the "Device" option as seen below.
 
 
I: Bus=0003 Vendor=056a Product=0016 Version=0403
 
N: Name="Wacom Graphire4 6x8"
 
P: Phys=
 
S: Sysfs=/class/input/input7
 
H: Handlers=mouse2 event7 ts2
 
B: EV=1f
 
B: KEY=1c63 0 70011 0 0 0 0 0 0 0 0
 
B: REL=100
 
B: ABS=100 3000003
 
B: MSC=1
 
Here is an example of the output for my ''Graphire4'' tablet. From this, we can determine that my tablet device goes through {{ic|/dev/input/event7}}.
 
 
Section "InputDevice"
 
Identifier  "stylus"
 
Driver      "wacom"
 
Option      "Type" "stylus"
 
Option      "Device" "/dev/input/event7" #for serial tablet, this might be e.g. "/dev/ttyS0" instead
 
Option      "USB" "on" #remove this line for serial tablets
 
Option      "Mode" "Absolute"
 
Option      "Vendor" "WACOM"
 
Option      "Threshold" "5"
 
EndSection
 
 
Section "InputDevice"
 
Identifier  "eraser"
 
Driver      "wacom"
 
Option      "Type" "eraser"
 
Option      "Device" "/dev/input/event7" #for serial tablet, this might be e.g. "/dev/ttyS0" instead
 
Option      "USB" "on" #remove this line for serial tablets
 
Option      "Mode" "Absolute"
 
Option      "Vendor" "WACOM"
 
Option      "Threshold" "5"
 
EndSection
 
 
Section "InputDevice"
 
Identifier  "cursor"
 
Driver      "wacom"
 
Option      "Type" "cursor"
 
Option      "Device" "/dev/input/event7" #for serial tablet, this might be e.g. "/dev/ttyS0" instead
 
Option      "USB" "on" #remove this line for serial tablets
 
Option      "Mode" "Absolute"
 
Option      "Vendor" "WACOM"
 
EndSection
 
Now update your ''Xorg'' config ({{ic|/etc/X11/xorg.conf}}) as above.
 
 
To learn about each of the Wacom tablet ''Xorg'' options checkout the ''man pages'' found at [http://linuxwacom.sourceforge.net/index.php/howto/inputdev Linux Wacom Project HOWTO - 5.1 - Adding the InputDevices].
 
 
I recommend you checkout [http://linuxwacom.sourceforge.net/index.php/howto/x11 Linux Wacom Project HOWTO - 5.0 - Configuring X11], I also recommend you checkout [http://gentoo-wiki.com/HOWTO_Wacom_Tablet#Xorg Gentoo Linux Wiki - HOWTO Wacom Tablet - Installing - Xorg].
 
 
==== TwinView Setup ====
 
 
If you are going to use two Monitors the aspect ratio while using the Tablet might feel unnatural. In order to fix this you need to add
 
 
Option "TwinView" "horizontal"
 
 
To all of your Wacom-InputDevice entries in the {{ic|xorg.conf}} file.
 
You may read more about that [http://ubuntuforums.org/showthread.php?t=640898 HERE]
 
 
==== Xrandr Setup ====
 
xrandr sets two monitors as one big screen, mapping the tablet to the whole virtual screen and deforming aspect ratio.
 
For a solution see this thread: [https://bbs.archlinux.org/viewtopic.php?pid=797617 archlinux forum].
 
 
If you just want to map the tablet to one of your screens, first find out what the screens are called
 
$ xrandr
 
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
 
'''HDMI-0''' disconnected (normal left inverted right x axis y axis)
 
'''DVI-0''' connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
 
  1920x1080      60.0*+
 
  1680x1050      60.0 
 
  ...
 
'''VGA-0''' connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm
 
  1920x1080      60.0*+
 
  1680x1050      60.0 
 
  ...
 
Then you need to know what is the ID of your tablet.
 
$ xsetwacom --list devices
 
WALTOP International Corp. Slim Tablet stylus  id: '''12'''  type: STYLUS
 
 
In my case I want to map the tablet (ID: '''12''') to the screen on the right, which is '''"VGA-0"'''. I can do that with this command
 
$ xsetwacom --set '''12''' MapToOutput '''"VGA-0"'''
 
This should immediately work, no root necessary.
 
 
If xsetwacom replies with "Unable to find an output ..." an X11 geometry string of the form '''WIDTHxHEIGHT+X+Y''' can be specified instead of the screen identifier. In this example
 
$ xsetwacom --set '''12''' MapToOutput '''"1920x1080+1920+0"'''
 
should also map the tablet to the screen on the right.
 
 
==== Graphire4 buttons ====
 
 
InputDevice    "pad" "SendCoreEvents"
 
Add this to the ''ServerLayout'' section of your ''Xorg'' config ({{ic|/etc/X11/xorg.conf}}).
 
 
*Note, it was mentioned at [http://gentoo-wiki.com/HOWTO_Wacom_Tablet#Graphire4_buttons Gentoo Linux Wiki - HOWTO Wacom Tablet - Installing - Xorg - Graphire4 buttons] that there was information somewhere advising NOT to add "SendCoreEvents" to the line above, but it was also said that without this these buttons will not work.
 
 
Section "InputDevice"
 
Identifier  "pad"
 
Driver      "wacom"
 
Option      "Type" "pad"
 
Option      "Device" "/dev/input/event7"  #for serial tablet, this might be e.g. "/dev/ttyS0" instead
 
Option      "USB" "on"#remove this line for serial tablets
 
Option      "ButtonsOnly" "on"
 
EndSection
 
Now update your ''Xorg'' config ({{ic|/etc/X11/xorg.conf}}) as above.
 
 
I recommend you checkout [http://gentoo-wiki.com/HOWTO_Wacom_Tablet#Graphire4_buttons Gentoo Linux Wiki - HOWTO Wacom Tablet - Installing - Xorg - Graphire4 buttons].
 
 
==== Tablet devices still do not appear ====
 
 
Start ''Xorg'' with tablet connected. Then look at logs ({{ic|/var/log/Xorg.0.log}}) and search for those errors:
 
 
  Error opening /dev/input/wacom : Success
 
  (EE) xf86OpenSerial: Cannot open device /dev/input/wacom
 
          No such file or directory.
 
 
This error will show even when device exists.
 
 
Second error is
 
 
  usbDetect: can not ioctl version
 
  Wacom xf86WcmWrite error : Invalid argument
 
 
If there are those errors, check if your wacom device is {{ic|/dev/input/ts3}} or another ts device (or symlink to this device). If it is, then device is handled by Compaq touchscreen emulation. This is ''tsdev'' module.
 
Just unload the module
 
 
  # modprobe -r tsdev
 
 
and add this module to blacklist in {{ic|/etc/rc.conf}}.
 
 
== WALTOP tablet support by the Wacom drivers ==
 
 
{{Note | The 'linuxwacom' package is now unsupported, and the drivers are only recommended for use with Xorg 1.7 or older. For current drivers <nowiki>(Xorg >= 1.8)</nowiki>, use the 'xf86-input-wacom' package from extra (It should not require this patch).}}
 
 
Since lately Wacom drivers cannot be started with WALTOP tablets, although the functionality is present. This is due to a vendor check in the ''wacom '' X.org driver. To bypass this check, download the ''linuxwacom'' sources (for example, the ''linuxwacom-cvs'' package from AUR) and apply a similar patch to {{ic|src/xdrv/wcmUSB.c}}:
 
 
% cat wcmUSB.c.diff
 
528,529c528,529
 
< /* vendor is wacom */
 
< if (sID[1] == 0x056A)
 
---
 
> /* vendor is wacom or waltop*/
 
> if (sID[1] == 0x056A || sID[1] == 0x172f)
 
 
== The GIMP ==
 
 
To enabled proper usage, and pressure sensitive painting in [http://www.gimp.org The GIMP], just go to ''Preferences &rarr; Input Devices &rarr; Configure Extended Input Devices...''. Now for each of your ''eraser'', ''stylus'', and ''cursor'' '''devices''', set the '''mode''' to ''Screen'', and remember to save.
 
 
*Please take note that if present, the ''pad'' '''device''' should be kept disabled as I do not think The GIMP supports such things. Alternatively, to use such features of your tablet you should map them to keyboard commands with a program such as [http://hem.bredband.net/devel/wacom/ Wacom ExpressKeys].
 
 
*You should also take note that the tool selected for the ''stylus'' is independent to that of the ''eraser''. This can actually be quite handy, as you can have the ''eraser'' set to be used as any tool you like.
 
 
I recommend you checkout [http://linuxwacom.sourceforge.net/index.php/howto/gimp Linux Wacom Project HOWTO - 10.0 - Working With Gimp], and the ''Setting up GIMP'' section of [http://www.gimptalk.com/forum/topic.php?t=17992&start=1 GIMP Talk - Community - Install Guide: Getting Wacom Drawing Tablets To Work In Gimp].
 
 
== Inkscape ==
 
 
As in The GIMP, to do the same simply got to ''File &rarr; Input Devices...''. Now for each of your ''eraser'', ''stylus'', and ''cursor'' '''devices''', set the '''mode''' to ''Screen'', and remember to save.
 
 
== Krita ==
 
 
Krita 2.0 and later only require that QT is able to use your tablet to function properly. If your tablet is not working in Krita, then make sure to check it is working in QT first. The effect of tablet pressure can then be tweaked in the painttop configuration, for example by selecting opacity, then selecting pressure from the drop down and adjusting the curve to your preference.
 
 
For earlier versions of Krita, simply go to ''Settings &rarr; Configure Krita...'' Click on ''Tablet'' and then like in Inkscape and GIMP set ''stylus'' and any others' mode to screen.
 
 
=== Bamboo ===
 
 
{{Note | Some users reported problems with linuxwacom 0.8.1-1 and Bamboo. Their Cursor jumped around when trying to use the stylus-tilt to avoid that problem simply use linuxwacom 0.8.0 (You can simply edit the pkgver in the PKGBUILD).}}
 
 
If you use an older version of linuxwacom it could happen that you will not be able to use your pen with GIMP or Inkscape when configured as above since the stylus is firing a button2 event instead of a button1 event, same with the eraser. To correct this add (do not just copy and paste the whole section, just add the part about the buttons) these lines to the appropriate section of your xorg.conf.
 
 
Section "InputDevice"
 
Driver        "wacom"
 
Identifier    "stylus"
 
Option        "Button1"      "1" #this line is important
 
Option        "Button2"      "1" #this line is important
 
EndSection
 
 
Section "InputDevice"
 
Driver        "wacom"
 
Identifier    "eraser"
 
Option        "Button1"      "1" #this line is important
 
Option        "Button2"      "1" #this line is important
 
EndSection
 
 
Be adviced that this way pressure sensitive painting in GIMP and Inkscape will work but the lower button of the pen will also fire a button1 event same as the stylus and eraser. You can not configure any other button for Button2, it got to be the same as Button1! There is no need to add these lines to the cursor section since the bamboo does not ship a mouse, still i advice you not to remove the cursor device as an input device, not even from the serverlayout section. That lead to an unstable xserver in my case.
 
 
If you are relying on hotplugging, the default fdi file contained in the packages xf86-input-wacom and linuxwacom will most likely not fully support your Bamboo tablet (e.g. stylus not working properly). Refer to the section on hotplugging above for a custom fdi file that supports the Bamboo (tested with model CTE-650).
 
 
== Wacom and VirtualBox ==
 
 
''My current setup is :
 
  Guest OS: Windows XP
 
  Tablet: Wacom Graphire4
 
  Linux Driver: xf86-input-wacom 0.8.4-1''
 
 
First, make sure that your tablet works well under Arch. Then, download and install the last driver from [http://www.wacom.com/downloads/drivers.php Wacom website] on the guest OS. Shutdown the virtual machine, go to '''Settings > USB'''. Select '''Add Filter From Device''' and select your tablet (e.g. WACOM CTE-440-U V4.0-3 [0403]). Select '''Edit Filter''', and change the last item '''Remote''' to '''Any'''.
 
 
== Pressure curves ==
 
 
You can add two options to xorg.conf to change how the pressure is registered when putting pressure on the pen. Example:
 
 
  Option        "PressCurve"    "50,0,100,50"        # Custom preference
 
  Option        "Threshold"    "60"                  # sensitivity to do a "click"
 
 
==Newer tablets & Troubleshooting==
 
 
Newer tablets's drivers might not be in the kernel yet, and additional manipulations might be needed.
 
For example, for the Wacom Bamboo Connect CTL-470/k and Pen & Touch CTH670, follow the instructions in [https://bbs.archlinux.org/viewtopic.php?id=131831 this thread].
 
'''There seems to be a problem with the CTH670 that is fixed in the attachment found in [http://www.mail-archive.com/linuxwacom-devel@lists.sourceforge.net/msg03922.html this post]'''
 
To compile it use the same instructions as in [https://bbs.archlinux.org/viewtopic.php?id=131831 this thread]
 
  
 
== References ==
 
== References ==

Revision as of 22:27, 21 October 2012

Introduction

Before we begin, I would like to point out that this guide was started for USB based Wacom tablets, so much of the info in here focuses on that. Usually it's recommended to rely on Xorg's auto-detection or to use a dynamic setup. However for an internal tablet device one might consider a static Xorg setup in case autodetection does not work. A static Xorg setup is usually not able to recognize your Wacom tablet when it's connected to a different USB port or even after unplugging and replugging it into the same port, and as such it should be considered as deprecated.

It is also worth to mention that this wiki article is very much influenced by the very helpful Gentoo Linux Wiki - HOWTO Wacom Tablet, which I recommend anyone visit if they would like to learn about things that are not covered here.

Installing

Check if kernel drivers needed (usually not)

After plugging in the tablet (in case of a USB device) check lsusb and/or dmesg to see if the kernel recognizes your tablet. It should also be listed in /proc/bus/input/devices.

In case it's not recognized, which might happen for new devices not supported by current kernel, it is also possible to install git version of kernel driver from: stable branch (wacom-linux-gitAUR), next branch (wacom-next-linux-gitAUR) or mainline branch (wacom-mainline-linux-gitAUR).

Install Wacom drivers

Thanks to The Linux Wacom Project, you only need to install the xf86-input-wacom package, which contains everything needed to use a Wacom tablet on Linux.

 # pacman -S xf86-input-wacom
Note: There is also xf86-input-wacom-gitAUR in AUR which provides git version of xf86-input-wacom, but you might encounter some troubles. For me the buttons for example did only work with the stable release, not with the git version. So it's recommended to try xf86-input-wacom irst.


Automatical setup

Newer versions of X should be able to automatically detect and configure your device. Before going any further, reboot your system and (re-)start X. Test if your device was recognized completely (i.e., that both pen and eraser work, if applicable), by issuing command

 $ xsetwacom --list devices

which should detect all devices with type, for example

 Wacom Bamboo 2FG 4x5 Pen stylus 	id: 8	type: STYLUS    
 Wacom Bamboo 2FG 4x5 Pen eraser 	id: 9	type: ERASER    
 Wacom Bamboo 2FG 4x5 Finger touch	id: 13	type: TOUCH     
 Wacom Bamboo 2FG 4x5 Finger pad 	id: 14	type: PAD       

You can also test it by opening Gimp or Xournal and checking the extended input devices section, or whatever tablet-related configuration is supported by the software of your choice.

For this to work you don't need any xorg.conf file, any configurations are made in files in the /etc/X11/xorg.conf.d/ folder. If everything is working you can skip the manual configuration and proceed to the configuration section to learn how to further customize your tablet.

With the arrival of Xorg 1.8 support for HAL was dropped in favor of udev which might break auto-detection for some tablets as fitting udev rules might not exist yet, so you may need to write your own.

If you have linuxwacom or linuxwacom-dev remove those packages first. They are known to cause problems with newer version of X. xf86-input-wacom is the only package you need to install the X11 drivers.


Manual setup

A manual configuration is done in /etc/X11/xorg.conf or in a separate file in the /etc/X11/xorg.conf.d/ directory. The Wacom tablet device is accessed using a input event interface in /dev/input/ which is provided by the kernel driver. The interface number event?? is likely to change when unplugging and replugging into the same or especially a different USB port. Therefore it's wise to don't refer to the device using it's concrete event?? interface (static configuration) but by letting udev dynamically create a symbolic link to the correct event file (dynamic configuration).

Dynamic with udev

Note: In AUR there is wacom-udev package, which includes udev-rules-file. You might skip this part and move on to the xorg.conf configuration if you are using the wacom-udev package from AUR.

Assuming udev is already installed you simply need to install wacom-udevAUR from AUR, e.g. by using

 $ yaourt -S wacom-udev
USB-devices

After (re-)plugging in your USB-tablet (or at least after rebooting) some symbolic links should appear in /dev/input refering to your tablet device.

 $ ls /dev/input/wacom* 
 /dev/input/wacom  /dev/input/wacom-stylus  /dev/input/wacom-touch

If not, your device is likely to be not yet included in the udev configuration from wacom-udev which resides in /usr/lib/udev/rules.d/10-wacom.rules. It's a good idea to copy the file e.g. to 10-my-wacom.rules before modifiing it, else it might be reverted by a package upgrade.

Add your device to the file by duplicating some line of another device and adapting idVendor,idProduct and the symlink name to your device. The two id's can by determined using

$ lsusb | grep -i wacom
Bus 002 Device 007: ID 056a:0062 Wacom Co., Ltd

In this example idVendor is 056a and idProduct 0062. In case you have device with touch (e.g. Bamboo Pen&Touch) you might need to add a second line for the touch input interface. For details check the linuxwacom wiki Fixed device files with udev.

Save the file and reload udev's configuration profile using the command udevadm control --reload-rules Check again the content of /dev/input to make sure that the wacom symlinks appeared. Note that you may need to plug-in the tablet again for the device to appear.

The files of further interest for the Xorg configuration are /dev/input/wacom and for a touch-device also /dev/input/wacom_touch.

Serial devices

The wacom-udevAUR should also include support for serial devices. Users of serial tablets might be also interested in the inputattach tool from linuxconsoleAUR package. The inputattach command allows to bind serial device into /dev/input tree, for example with:

 # inputattach --w8001 /dev/ttyS0

See man inputattach for help about available options. As for USB devices one should end up with a file /dev/input/wacom and proceed with the Xorg configuration.

Static setup

If you insist in using a static setup just refer to your tablet in the Xorg configuration in the next section using the correct /dev/input/event?? files as one can find out by looking into /proc/bus/input/devices.

Xorg configuration

In either case, dynamic or static setup you got now one or two files in /dev/input/ which refer to the correct input event devices of your tablet. All that is left to do is add the relevent information to /etc/X11/xorg.conf, or a dedicated file under /etc/X11/xorg.conf.d/. The exact configuration depends on your tablet's features of course. xsetwacom --list devices might give helpful informations on what InputDevice sections are needed for your tablet.

An example configuration for a Volito2 might look like this

Section "InputDevice"
    Driver        "wacom"
    Identifier    "stylus"
    Option        "Device"       "/dev/input/wacom"   # or the corresponding event?? for a static setup
    Option        "Type"         "stylus"
    Option        "USB"          "on"                 # USB ONLY
    Option        "Mode"         "Relative"           # other option: "Absolute"
    Option        "Vendor"       "WACOM"
    Option        "tilt"         "on"  # add this if your tablet supports tilt
    Option        "Threshold"    "5"   # the official linuxwacom howto advises this line
EndSection
Section "InputDevice"
    Driver        "wacom"
    Identifier    "eraser"
    Option        "Device"       "/dev/input/wacom"   # or the corresponding event?? for a static setup
    Option        "Type"         "eraser"
    Option        "USB"          "on"                  # USB ONLY
    Option        "Mode"         "Relative"            # other option: "Absolute"
    Option        "Vendor"       "WACOM"
    Option        "tilt"         "on"  # add this if your tablet supports tilt
    Option        "Threshold"    "5"   # the official linuxwacom howto advises this line
EndSection
Section "InputDevice"
    Driver        "wacom"
    Identifier    "cursor"
    Option        "Device"       "/dev/input/wacom"   # or the corresponding event?? for a static setup
    Option        "Type"         "cursor"
    Option        "USB"          "on"                  # USB ONLY
    Option        "Mode"         "Relative"            # other option: "Absolute"
    Option        "Vendor"       "WACOM"
EndSection

Make sure that you also change the path ("Device") to your mouse, as it will be /dev/input/mouse_udev now.

Section "InputDevice"
    Identifier  "Mouse1"
    Driver      "mouse"
    Option      "CorePointer"
    Option      "Device"             "/dev/input/mouse_udev"
    Option      "SendCoreEvents"     "true"
    Option      "Protocol"           "IMPS/2"
    Option      "ZAxisMapping"       "4 5"
    Option      "Buttons"            "5"
EndSection

Add this to the ServerLayout section

InputDevice "cursor" "SendCoreEvents" 
InputDevice "stylus" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"

And finally make sure to update the indentifier of your mouse in the ServerLayout section – as mine went from

InputDevice    "Mouse0" "CorePointer"

to

InputDevice    "Mouse1" "CorePointer"

Configuration

General concepts

The configuration can be done in two ways temporary using the `xsetwacom` tool, which is included in xf86-input-wacom or permanent in xorg.conf or better in a extra file in /etc/X11/xorg.conf.d. The possible options are identical so it's recommended to first use `xsetwacom` for testing and later add the final config to the Xorg configuration files.

Temporary configuration

For the beginning it's a good idea to inspect the default configuration and all possible options using the following commands.

 $ xsetwacom --list devices                    # list the available devices for the get/set commands
 Wacom Bamboo 16FG 4x5 Finger touch	id: 12	type: TOUCH
 Wacom Bamboo 16FG 4x5 Finger pad	id: 13	type: PAD       
 Wacom Bamboo 16FG 4x5 Pen stylus	id: 17	type: STYLUS    
 Wacom Bamboo 16FG 4x5 Pen eraser	id: 18	type: ERASER
 $ xsetwacom --get "Wacom Bamboo 16FG 4x5" all # using the device name
 $ xsetwacom --get 17 all                      # or equivalently use the device id
 $ xsetwacom --list parameters                 # to get an explanation of the Options
 $ man wacom                                   # get even more details

Caution, don't use the device id when writing shell scripts to set some options as the ids might change after an hotplug.

Options can be changed with the --set flag. Some useful examples are

 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" ScrollDistance 50  # change scrolling speed
 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" Gesture off        # disable multitouch gestures
 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" Touch off          # disable touch

For further configuration tips and tricks see below in #Specific configuration tips.

Note: You can reset your temporary configuration at any time by unplugging and replugging in your tablet.

Permanent configuration

To make a permanent configuration the preferred way for Xorg>1.8 is to create a new file in /etc/X11/xorg.conf.d e.g. 52-wacom-options.conf with the following content.

/etc/X11/xorg.conf.d/52-wacom-options.conf
Section "InputClass"
    Identifier "Wacom Bamboo stylus options"
    MatchDriver "wacom"
    MatchProduct "Pen"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    Option "RawSample" "20"
    Option "PressCurve" "0,10,90,100"
EndSection

Section "InputClass"
    Identifier "Wacom Bamboo eraser options"
    MatchDriver "wacom"
    MatchProduct "eraser"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    Option "RawSample" "20"
    Option "PressCurve" "5,0,100,95"
EndSection

Section "InputClass"
    Identifier "Wacom Bamboo touch options"
    MatchDriver "wacom"
    MatchProduct "Finger"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    Option "ScrollDistance" "18"
    Option "TapTime" "220"
EndSection

Section "InputClass"
    Identifier "Wacom Bamboo pad options"
    MatchDriver "wacom"
    MatchProduct "pad"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    
    # Setting up buttons
    Option "Button1" "1"
    Option "Button2" "2"
    Option "Button3" "3"
    Option "Button4" "0"
EndSection

The identifiers can be set arbitrarily. The option names are (except for the buttons) identical to the ones listed by xsetwacom --list parameters and especially also in man wacom. As noted in #Remapping Buttons the button ids seem to be different than the ones for xsetwacom.

Specific configuration tips

Check out the [Howto section] in the Linuxwacom wiki.

Changing orientation

If you want to use your tablet in a different orientation you have to tell this to the driver, else the movements don't cause the expected results. This is done by setting the Rotate option for all devices. Possible orientations are none,cw,ccw and half. A quick way is e.g.

 $ for i in 12 13 17 18; do xsetwacom --set $i Rotate half; done   # remember the ids might change when hotplugging

or use the following script like this ./wacomrot.sh half

wacomrot.sh
#!/bin/bash
device="Wacom Bamboo 16FG 4x5"
stylus="$device Pen stylus"
eraser="$device Pen eraser"
touch="$device Finger touch"
pad="$device Finger pad"

xsetwacom --set "$stylus" Rotate $1
xsetwacom --set "$eraser" Rotate $1
xsetwacom --set "$touch"  Rotate $1
xsetwacom --set "$pad"    Rotate $1

Remapping Buttons

It's possible to remap the buttons with hotkeys.

Finding out the button IDs

Sometimes it needs some trial&error to find the correct button IDs. For me they even differ for xsetwacom and the xorg.conf configuration. Very helpful tools are xev or xbindkeys -mk. An easy way to proceed is the following

 $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 1
 $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 2 2
 $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 3 3
 $ # and so on

Then fire up xev from a terminal window, place your mouse cursor above the window and hit the buttons and write down the ids.

The syntax

The syntax of xsetwacom is flexible but not very well documented. The general mapping syntax (extracted from the source code) for xsetwacom 0.17.0 is the following.

 KEYWORD [ARGS...] [KEYWORD [ARGS...] ...]
 
 KEYWORD + ARGS:
   key [+,-]KEY [[+,-]KEY ...]  where +:key down, -:key up, no prefix:down and up
   button BUTTON [BUTTON ...]   (1=left,2=middle,3=right mouse button, 4/5 scroll mouse wheel)
   modetoggle                   toggle absolute/relative tablet mode 
   displaytoggle                toggle cursor movement among all displays which include individual screens
                                plus the whole desktop for the selected tool if it is not a pad.
                                When the tool is a pad, the function applies to all tools that are asssociated
                                with the tablet
 
 BUTTON: button ID as integer number
 
 KEY: MODIFIER, SPECIALKEY or ASCIIKEY
 MODIFIER: (each can be prefix with an l or an r for the left/right modifier (no prefix = left)
    ctrl=ctl=control, meta, alt, shift, super, hyper
 SPECIALKEY: f1-f35, esc=Esc, up,down,left,right, backspace=Backspace, tab, PgUp,PgDn
 ASCIIKEY: (usual characters the key produces, e.g. a,b,c,1,2,3 etc.)
Some examples
 $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 3 # right mouse button
 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +ctrl z -ctrl"
 $ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 1
 key +Control_L +z -z -Control_L
 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +shift button 1 key -shift"

even little macros are possible

 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +shift h -shift e l l o"
Note: There seems to be a bug in the xf86-input-wacom driver version 0.17.0, at least for my Wacom Bamboo Pen & Touch, but I guess this holds in general. It causes the keystrokes not to be overwritten correctly.
 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key a b c" # press button 1 -> abc
 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key d"     # press button 1 -> dbc  WRONG!

A simple workaround is to reset the mapping by mapping to "":

 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 ""          # to reset the mapping
 $ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key d"     # press button 1 -> d
Execute custom commands

Mapping custom commands to the buttons is a little bit tricky but actually very simple. You'll need xbindkeys so install it using

 # pacman -S xbindkeys

To get well defined button codes add the following to your permanent configuration file, e.g. /etc/X11/xorg.conf.d/52-wacom-options.conf in the InputClass section of your pad device. Map the tablet's buttons to some unused button ids.

 # Setting up buttons (preferably choose the correct button order, so the topmost key is mapped to 10 and so on)
 Option "Button1" "10"
 Option "Button2" "11"
 Option "Button3" "12"
 Option "Button4" "13"

Then restart your Xorg server and verify the buttons using xev or xbindkeys -mk.

Now set up your xbindkeys configuration, if you don't already have one you might want to create a default configuration

 $ xbindkeys --defaults > ~/.xbindkeysrc

Then add your custom key mapping to ~/.xbindkeysrc, for example

 "firefox"
     m:0x10 + b:10   (mouse)
 "xterm"
     m:0x10 + b:11   (mouse)
 "xdotool key ctrl-z"
     m:0x10 + b:12   (mouse)
 "send-notify Test "No need for escaping the quotes""
     m:0x10 + b:13   (mouse)
Application specific hotkeys

This is quite tricky as the usual tools don't allow application specific hotkeys. However I found the idea quite appealing to use the buttons for different thinks depending on the application.

To make this possible I use a python script which uses xorg-xprop, xdotools and the custom commands setup from the last section, which depends on xbindkeys.

Change the mappings in ~/.xbindkeysrc

 "appkey 1"
     m:0x10 + b:10   (mouse)
 "appkey 2"
     m:0x10 + b:11   (mouse)
 "appkey 3"
     m:0x10 + b:12   (mouse)
 "appkey 4"
     m:0x10 + b:13   (mouse)

And copy the following script to a file named appkey somewhere in your path ($PATH) and make it executable using

 chmod 755 /usr/local/bin/appkey
/usr/local/bin/appkey
#!/usr/bin/python
# written in 2012 by buergi
# this script is public domain, no rights reserved, CC0
# do with it whatever you want

import sys
from subprocess import Popen,PIPE

def get_active_window_class(sep=':'):
    p = Popen(['xdotool', 'getactivewindow'], stdout=PIPE)
    winid  = p.communicate()[0]
    p = Popen(['xprop', '-id', winid, 'WM_CLASS'], stdout=PIPE)

    try:
        out = p.communicate()[0].decode('ascii')
    except UnicodeDecodeError as e:
        return 

    try:
        tmp = out.split(' = ',1)[1]
        winclass = sep.join(tmp.split('", "'))[1:-2]
    except IndexError as e:
        return 

    return winclass

def send_key(keystroke):
    Popen(['xdotool', 'key', keystroke])

def main(argc,argv):
    key=0
    if argc==2:
        key=argv[1]
    else:
        print("Usage: %s KEY"%argv[0])

    cls = get_active_window_class()
    if 'Firefox' in cls: # my configuration for Pentadactyl
        if key=='1':
            send_key('shift+h')
        if key=='2':
            send_key('shift+l')
        if key=='3':
            send_key('Escape')
            send_key('r')
    if 'Inkscape' in cls:
        if key=='1':
            send_key('F1')
        if key=='2':
            send_key('F2')
        if key=='3':
            send_key('ctrl+F6')
    if key=='4':
        # toggle finger touch
        p=Popen(['xsetwacom','--get','Wacom Bamboo 16FG 4x5 Finger touch','Touch'],stdout=PIPE)
        stat  = p.communicate()[0].decode('ascii').strip()
        istat = 'on' if 'off' in stat else 'off'
        Popen(['xsetwacom','--set','Wacom Bamboo 16FG 4x5 Finger touch','Touch',istat])
    return 0

if __name__ == '__main__':
    main(len(sys.argv),sys.argv)


TwinView Setup

If you are going to use two Monitors the aspect ratio while using the Tablet might feel unnatural. In order to fix this you need to add

Option "TwinView" "horizontal"

To all of your Wacom-InputDevice entries in the xorg.conf file. You may read more about that HERE

Xrandr Setup

xrandr sets two monitors as one big screen, mapping the tablet to the whole virtual screen and deforming aspect ratio. For a solution see this thread: archlinux forum.

If you just want to map the tablet to one of your screens, first find out what the screens are called

$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
  1920x1080      60.0*+
  1680x1050      60.0  
  ...
VGA-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm
  1920x1080      60.0*+
  1680x1050      60.0  
  ...

Then you need to know what is the ID of your tablet.

$ xsetwacom --list devices
WALTOP International Corp. Slim Tablet stylus   id: 12  type: STYLUS

In my case I want to map the tablet (ID: 12) to the screen on the right, which is "VGA-0". I can do that with this command

$ xsetwacom --set 12 MapToOutput "VGA-0"

This should immediately work, no root necessary.

If xsetwacom replies with "Unable to find an output ..." an X11 geometry string of the form WIDTHxHEIGHT+X+Y can be specified instead of the screen identifier. In this example

$ xsetwacom --set 12 MapToOutput "1920x1080+1920+0"

should also map the tablet to the screen on the right.

Pressure curves

You can add two options to xorg.conf to change how the pressure is registered when putting pressure on the pen. Example:

 Option        "PressCurve"    "50,0,100,50"         # Custom preference
 Option        "Threshold"     "60"                  # sensitivity to do a "click"

Application-specific configuration

The GIMP

To enabled proper usage, and pressure sensitive painting in The GIMP, just go to Preferences → Input Devices → Configure Extended Input Devices.... Now for each of your eraser, stylus, and cursor devices, set the mode to Screen, and remember to save.

  • Please take note that if present, the pad device should be kept disabled as I do not think The GIMP supports such things. Alternatively, to use such features of your tablet you should map them to keyboard commands with a program such as Wacom ExpressKeys.
  • You should also take note that the tool selected for the stylus is independent to that of the eraser. This can actually be quite handy, as you can have the eraser set to be used as any tool you like.

For more information checkout the Setting up GIMP section of GIMP Talk - Community - Install Guide: Getting Wacom Drawing Tablets To Work In Gimp.

Inkscape

As in The GIMP, to do the same simply got to File → Input Devices.... Now for each of your eraser, stylus, and cursor devices, set the mode to Screen, and remember to save.

Krita

Krita 2.0 and later only require that QT is able to use your tablet to function properly. If your tablet is not working in Krita, then make sure to check it is working in QT first. The effect of tablet pressure can then be tweaked in the painttop configuration, for example by selecting opacity, then selecting pressure from the drop down and adjusting the curve to your preference.

For earlier versions of Krita, simply go to Settings → Configure Krita... Click on Tablet and then like in Inkscape and GIMP set stylus and any others' mode to screen.

VirtualBox

My current setup is :

 Guest OS: Windows XP
 Tablet: Wacom Graphire4
 Linux Driver: xf86-input-wacom 0.8.4-1

First, make sure that your tablet works well under Arch. Then, download and install the last driver from Wacom website on the guest OS. Shutdown the virtual machine, go to Settings > USB. Select Add Filter From Device and select your tablet (e.g. WACOM CTE-440-U V4.0-3 [0403]). Select Edit Filter, and change the last item Remote to Any.


Newer tablets & Troubleshooting

Newer tablets's drivers might not be in the kernel yet, and additional manipulations might be needed. For example, for the Wacom Bamboo Connect CTL-470/k and Pen & Touch CTH670, follow the instructions in this thread. There seems to be a problem with the CTH670 that is fixed in the attachment found in this post To compile it use the same instructions as in this thread


Dynamic Xorg setup with HAL (deprecated)

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: HAL support was dropped in Xorg 1.8 which entered the repos in June 2010, it should not be used anymore (Discuss in Talk:Wacom Tablet#)


Note: In Xorg 1.8 and later, support for HAL is dropped. Input hotplugging will NOT work with these versions of X, you need to use udev (see above) instead.
Note: The linuxwacom package from AUR already includes a fitting fdi file, so you might skip this part and just try out if it works after installing linuxwacom and restarting X.

To use a Wacom/WALTOP/N-Trig tablet with HAL Xorg hotplugging create /etc/hal/fdi/policy/10-tablet.fdi with this code:

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

<deviceinfo version="0.2">
 <device>
   <match key="info.capabilities" contains="input">
     <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>
     </match>
     <match key="info.product" contains="WALTOP">
       <merge key="input.x11_driver" type="string">wacom</merge>
       <merge key="input.x11_options.Type" type="string">stylus</merge>
     </match>
   </match>
   <match key="info.product" contains="HID 1b96:0001">
     <match key="info.parent" contains="if0">
      <merge key="input.x11_driver" type="string">wacom</merge>
      <merge key="input.x11_options.Type" type="string">stylus</merge>
     </match>
   </match>
  </device>
 </deviceinfo>

Then kill your X server, restart HAL and start the X server again.

Following fdi file is known to work with the Bamboo Fun tablet (model CTE-650). Using this file corrects several problems with the stylus that appear when using the default fdi file above. Create the file /etc/hal/fdi/policy/10-tablet.fdi with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.category" contains="input">
      <match key="info.product" contains_outof="Wacom">
        <merge key="input.x11_driver" type="string">wacom</merge>
        <merge key="input.x11_options.Type" type="string">pad</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">stylus</append>
      </match>
    </match>
    <match key="info.capabilities" contains="serial">
      <match key="@info.parent:pnp.id" contains_outof="WACf001;WACf002;WACf003;WACf004;WACf005;WACf006;WACf007;WACf008;WACf009;WACf00a;WACf00b;WACf00c;FUJ02e5">
        <append key="info.capabilities" type="strlist">input</append>
        <merge key="input.x11_driver" type="string">wacom</merge>
        <merge key="input.x11_options.Type" type="string">pad</merge>
        <merge key="input.x11_options.ForceDevice" type="string">ISDV4</merge>
        <merge key="input.device" type="copy_property">serial.device</merge>
        <append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
        <append key="wacom.types" type="strlist">stylus</append>
        <match key="@info.parent:pnp.id" contains_outof="WACf008;WACf009">
          <append key="wacom.types" type="strlist">touch</append>
        </match>
      </match>
    </match>
  </device>
  <device>
    <match key="info.capabilities" contains="input.mouse">
      <match key="info.product" contains="WACOM">
        <match key="info.product" contains="Tablet">
          <merge key="input.x11_driver" type="string">wacom</merge>
          <merge key="input.x11_options.Type" type="string">pad</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">stylus</append>
        </match>
      </match>
    </match>
  </device>
</deviceinfo>

HAL tablet calibration fix

In order for calibration to work even when the screen is rotated (this applies for both serial and USB tablets), the wacom-names script is useful. It renames your X input devices so that they can be recognized by the linuxwacom driver. Download it from here. You need to be a Ubuntu forums member to download it. If you are not, here is the script. Remember, it was originally intended for Ubuntu so the instructions do not all apply to us Archers:

# wacom-names script by Roger E. Critchlow, Jr. (4-12-09)
#   modified by gali98/Favux (4-14-09)
#
# Place the wacom-names script in  /etc/init.d/wacom-names and link it as
# /etc/rc{2,3,4,5}.d/S27wacom-names.
# Use "sudo update-rc.d wacom start 27 2 3 4 5 ." or "sudo update-rc.d wacom defaults 27".
# Using S27 starts the script after hal and before gdm.  This allows us to modify the hal
# properties before the xserver sees them for the first time.
#
# The script renames the input devices back to what wacomcpl and xsetwacom expect them to
# be, so rotation and interactive calibration work.  It also enables xorg.conf & .xinitrc
# style configuration of Wacom features like the stylus button(s) and calibration.
#
# The script needs to be executable.  chmod +x wacom-names

#! /bin/sh
## find any wacom devices
for udi in `hal-find-by-property --key input.x11_driver --string wacom`
do
type=`hal-get-property --udi $udi --key input.x11_options.Type`
## rewrite the names that the Xserver will use
hal-set-property --udi $udi --key info.product --string $type
#
## To add a xorg.conf or xsetwacom (.xinitrc) style configuration, say mapping a stylus
## button, you could add to the script:
#case $type in
#stylus|eraser)
## eg:  map stylus button 2 to mouse button 3 (right click)
#hal-set-property --udi $udi --key input.x11_options.Button2 --string 3
#
#;;
#esac
done

Copy and paste and (or directly) save it as wacom-names to /etc/rc.d and make it an executable.

# chmod +x /etc/rc.d/wacom-names

Add wacom-names to the DAEMONS line in your rc.conf. Make sure to put it after HAL, and do not background HAL, because this script will not work if it runs before HAL has started. For example:

DAEMONS=(syslog-ng @crond hal @acpid @alsa @gpm wacom-names)

Reboot your computer. From here you can either keep wacom-names in your rc.conf if your rotation script calls on xsetwacom directly, or if you just need the calibration data, you can now use wacomcpl.

If you are looking for more information, this thread at the Ubuntu forums is incredibly useful, and also provided the link to Rec's wacom-names script.


References