Difference between revisions of "Wacom Serial Tablet PC Stylus"

From ThinkWiki
Jump to: navigation, search
(Models featuring this Device)
(changed category)
 
(53 intermediate revisions by 22 users not shown)
Line 1: Line 1:
__NOTOC__
+
ThinkPad and other portable computers have integrated Wacom digitiser technology [http://ps-2.kev009.com/ohlandl/2524/2524.html since at least 1994 ThinkPad 730T.] {{730T}} {{730TE}}  During the years of Windows XP Tablet PC Edition, Wacom marketed the technology as 'Wacom Penabled'.
{| width="100%"
+
 
|style="vertical-align:top" |[[Image:Logo_wacom.gif|Wacom Logo]]
+
=ThinkPad X41 Tablet Digitizer Pen=
|style="vertical-align:top" |
+
[[File:Logo_wacom.gif|alt=stock picture of ThinkPad X41 Tablet Digitizer Pen|]]
<div style="margin:0px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;">
+
The ThinkPad {{X41t}} Digitizer Pen has red tips, a pocket clip, dual side-switch, no eraser.  It fits in the X41 Tablet pen storage area.
 +
 
 +
==part numbers==
 +
*Wacom model UP-814-54A
 +
*Marketing part number 73P5188
 +
**FRU P/N 39T0803 (replaced by 39T7303)
 +
**IBM P/N 39T7302, FRU P/N 39T7303
 +
**UPC 000435611079, EAN 5050689611078, JAN 4560209481797
 +
<!-- I found number 39T7652 along 39T7302 and 39T7303 in a ebay photo - Numeric -->
 +
 
 +
==documentation==
 +
*[http://download.lenovo.com/ibmdl/pub/pc/pccbbs/options/x41pen.pdf User Manual] 2.39MB, pdf
 +
*[http://forum.wacom.eu/viewtopic.php?f=8&t=15663&p=55664#p55664 a message from Wacom about nib length]
 +
*{{IBMDOCURL|MIGR-60008|System service parts - ThinkPad X41 Tablet}}
 +
*{{IBMDOCURL|MIGR-60036|ThinkPad X41 Tablet Accessories - Overview}}
 +
*{{IBMDOCURL|MIGR-60039|ThinkPad X41 Tablet Accessories - Service parts}}
 +
*{{IBMDOCURL|MIGR-60071|ThinkPad X41 Tablet Digitizer Pen - Publications}}
 +
*{{IBMDOCURL|MIGR-60175|ThinkPad X41 Tablet Accessories - ThinkPad X41 Tablet}}
 +
 
 +
 
 +
 
 +
=ThinkPad Tablet Digitizer Pen=
 +
This generic-sounding pen has a red tip, single side-switch, grey eraser, and pocket clip.  It was first used with {{X60t}}, but it fits in the pen storage area also for the following systems: ThinkPad {{X60t}}, {{X61t}}, {{X200 Tablet}}, {{X201 Tablet}}, {{W700}}, {{W700ds}}, {{W701}}, {{W701ds}}.
 +
 
 +
==part numbers==
 +
*Marketing part number 41U3143
 +
**Lenovo P/N: 39T7481, FRU P/N: 39T7482
 +
<!-- I found uncertain number 39T3583 along real numbers 39T7481 and 39T7482 in a ebay photo - Numeric -->
 +
**Lenovo P/N: 45N2630, FRU P/N: 45N2631
 +
*ThinkPad Tablet Tether 3-pack: 41U4820
 +
**UPC 882861963942, EAN 0882861963942, JAN 4560209531621
 +
 
 +
==documentation==
 +
*{{IBMDOCURL|MIGR-66714|ThinkPad Tablet Accessories (ThinkPad X60 Tablet Sleeve, ThinkPad Tablet Digitizer Pen, ThinkPad Tablet Teather) - Overview}}
 +
*{{IBMDOCURL|MIGR-66717|ThinkPad Tablet Accessories (ThinkPad X60 Tablet Sleeve, ThinkPad Tablet Digitizer Pen, ThinkPad Tablet Teather) - Service parts}}
 +
*{{IBMDOCURL|MIGR-67023|System service parts - ThinkPad X60 Tablet, X61 Tablet}}
 +
*{{IBMDOCURL|MIGR-68049|Keyboard & mouse accessories - ThinkPad X61 Tablet}}
 +
*{{IBMDOCURL|MIGR-70561|System service parts - ThinkPad W700, W700ds, W701 and W701ds}}
 +
*{{IBMDOCURL|MIGR-70697|System service parts - ThinkPad X200 Tablet, X201 Tablet}}
 +
*{{IBMDOCURL|MIGR-71598|Digitizer pen removal - ThinkPad W700, W700ds, W701, W701ds}}
 +
 
 +
=ThinkPad X200 Tablet Pen and Touch=
 +
This tablet uses a serial connection for the stylus and touch screen.
 +
If you'd like to see raw output from it, type:
 +
cat /dev/ttyS0
 +
CTRL-C to stop.  If your terminal is corrupted, type 'reset' and press Enter.
 +
 
 +
== systemd ==
 +
*You need the ''inputattach'' program.  This may be part of a ''joystick'' package on your system.  In Gentoo, it is part of ''games-util/joystick''.
 +
*You can test ''inputattach'' by running:
 +
inputattach --w8001 /dev/ttyS0
 +
Now try to touch the screen with your finger or either end of the stylus.  This is blocking.  Press CTRL-C to stop it.
 +
*To have this mapping occur automatically, create /etc/systemd/system/wacom-serial.service
 +
[Unit]
 +
Description=Tie Wacom Serial Device to XInput
 +
 +
[Service]
 +
ExecStart=/usr/bin/inputattach --w8001 /dev/ttyS0
 +
 +
[Install]
 +
WantedBy=multi-user.target
 +
*Enable the new script in systemd.
 +
systemctl enable wacom-serial
 +
*If you're not rebooting, start the new service.
 +
systemctl start wacom-serial
 +
*You should see an input for touch, pen, and eraser if you run 'xinput':
 +
TODO
 +
 
 +
 
 +
=ThinkPad X220 Tablet Digitiser Pen=
 +
The ThinkPad {{X220 Tablet}} pen has a black tip, single side-switch, red eraser, and pocket clip.  This colour option is also used in {{X230 Tablet}}
 +
 
 +
==part numbers==
 +
**Lenovo P/N: 0A72243, FRU P/N: 04W1477
 +
**Lenovo P/N: 0B42547
 +
 
 +
==documentation==
 +
*{{IBMDOCURL|MIGR-77198|System service parts - ThinkPad X220 Tablet, X220i Tablet}}
 +
 
 +
 
 +
=ThinkPad X1 Yoga Digitizer Pen=
 +
The ThinkPad {{X1 Yoga}} pen has a black tip and two side buttons (one is for the eraser). The laptop comes with the pen by default and has a pen slot on the side.
 +
 
 +
==part numbers==
 +
* Wacom ActPen, TP, 6.5mm
 +
** Lenovo FRU P/N: 00HN897
 +
 
 +
=Linux Support=
 +
The pen is supported by the XFree/Xorg Wacom driver. New tablets also have the [[MultiTouch]] capability. [[MultiTouch]] is experimentally supported presently by the Linux wacom project. The pen works regardless of [[MultiTouch]] support.
 +
 
 
=== Wacom Serial Tablet PC Stylus ===
 
=== Wacom Serial Tablet PC Stylus ===
 
This is a stylus made for tablet PCs by Wacom.
 
This is a stylus made for tablet PCs by Wacom.
Line 9: Line 98:
 
* Chipset: Wacom
 
* Chipset: Wacom
 
* Serial: irq 5 port 0x0200
 
* Serial: irq 5 port 0x0200
</div>
 
|}
 
  
==Linux Support==
+
==First steps==
The pen is supported by the XFree/Xorg Wacom driver. New tablets also have the [[MultiTouch]] capability. [[MultiTouch]] is NOT supported presently, but the pen still works on such devices.
+
Get the [http://linuxwacom.sourceforge.net/index.php/dl linux wacom driver] and install it on your system.
  
 
The pen uses serial and appears on some {{path|/dev/ttySnn}} device where <tt>nn</tt> is a number. An easy way to find it is to map {{path|/dev/ttyS0}} to the pen's port and irq. The values can be found under the windows driver properties. Using values from an {{X41T}} 1869-5CU, the command is: {{cmdroot|setserial /dev/ttyS0 port 0x0200 irq 5 autoconfig}} (you need to run this after every suspend/resume cycle).
 
The pen uses serial and appears on some {{path|/dev/ttySnn}} device where <tt>nn</tt> is a number. An easy way to find it is to map {{path|/dev/ttyS0}} to the pen's port and irq. The values can be found under the windows driver properties. Using values from an {{X41T}} 1869-5CU, the command is: {{cmdroot|setserial /dev/ttyS0 port 0x0200 irq 5 autoconfig}} (you need to run this after every suspend/resume cycle).
  
This may be inserted into startup scripts in {{path|/etc/rc.d/}}
+
This may be inserted into startup scripts in {{path|/etc/rc.d/}} or {{path|/etc/rc.local}}
 +
 
 +
After mapping the pen, you can check its output with {{cmdroot|wacdump -f tpc /dev/ttyS0}}. This will list raw information about the pens position an click status. Hit Ctrl+C to exit wacdump.
 +
 
 +
==Setting up your Xorg.conf==
 +
===X-Server >= 1.8 (udev)===
 +
since X-Server 1.8 udev is the default way to detect any wacom-tablet. on some distributions you have to add the file ''/etc/udev/rules.d/10-wacom.rules'' with following content:
 +
 
 +
    ACTION!="add|change", GOTO="wacom_end"
 +
    # 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"
 +
 
 +
and ''/usr/share/X11/xorg.conf.d/50-wacom'':
 +
 
 +
    Section "InputClass"
 +
        Identifier "Wacom serial class identifiers"
 +
        MatchProduct "WACf|WACf004|FUJ02e5|FUJ02e7"
 +
        Driver "wacom"
 +
    EndSection
  
The X config file needs to be changed to use the stylus. Add the following sections to your xorg.conf:
+
''thanks to the [https://wiki.archlinux.org/index.php/Wacom_Tablet#Tablet_PC_with_serial_Wacom_tablet_device_.28Xorg_.3E_1.8.29 Wacom Tablet - ArchWiki]page and [https://bbs.archlinux.org/viewtopic.php?pid=781004#p781004 this] Archlinux-Thread''
 +
 
 +
===X-Server >=1.6? (hal)===
 +
if HAL is configured as it should be, your wacom-tablet is working out of the box
 +
 
 +
===older X-Server (static configuration)===
 +
If you are sure, you don't want to update to a newer version, add the following sections to your xorg.conf:
  
 
     Section "InputDevice"
 
     Section "InputDevice"
Line 46: Line 159:
 
     EndSection
 
     EndSection
  
 +
    # support for "touch" (with finger, available on x200t and some x61t)
 +
  Section "InputDevice"
 +
    Driver        "wacom"
 +
    Identifier    "touch"
 +
    Option        "Device"        "/dev/ttyS0"          # SERIAL ONLY
 +
    Option        "Type"          "touch"
 +
    Option        "ForceDevice"  "ISDV4"              # Serial Tablet PC ONLY
 +
  EndSection
  
Add the following lines to the ServerLayout section:
+
  Section "ServerLayout"
 
+
    Identifier    "Default Layout"
    InputDevice    "cursor" "SendCoreEvents"
+
    Screen 0 "Default Screen"  0 0
    InputDevice    "stylus" "SendCoreEvents"
+
    InputDevice    "Configured Mouse"    "CorePointer"
 +
    InputDevice    "cursor" "SendCoreEvents"
 +
    InputDevice    "stylus" "SendCoreEvents"
 +
    InputDevice    "eraser" "SendCoreEvents"
 +
    #InputDevice  "touch"  "SendCoreEvents" #Uncomment if you have this feature.
 +
  EndSection
  
 
Check the wacom driver man page and [http://linuxwacom.sf.net/ website] for other options.
 
Check the wacom driver man page and [http://linuxwacom.sf.net/ website] for other options.
Line 59: Line 185:
  
 
     #!/bin/bash
 
     #!/bin/bash
     xsetwacom set stylus Button1 "button 1"
+
     xsetwacom set stylus Button1 1
     xsetwacom set stylus Button2 "button 1"
+
    xsetwacom set stylus Button2 3
     xsetwacom set stylus Button3 "button 3"
+
    xsetwacom set stylus Button3 3
 +
 
 +
==Wacomcpl==
 +
I found it useful to create a .desktop file for launching the wacomcpl program which is used for many user options for the tablet pen.
 +
 
 +
    [Desktop Entry]
 +
    Type=Application
 +
    Encoding=UTF-8
 +
    Name=wacomcpl
 +
    GenericName=linux wacom config
 +
    Comment=linux wacom configuration tool
 +
    TryExec=wacomcpl
 +
    Exec=wacomcpl
 +
    Terminal=false
 +
    Categories=System;
 +
    Icon=wacomcpl.png
 +
 
 +
To have your settings restore after logout/suspend/restart you will need to edit {{path|/home/yourusername/.xinitrc}}.
 +
Go to the last line and change
 +
 
 +
    . /etc/X11/xinit/xinitrc
 +
 
 +
to read as
 +
 
 +
    # . /etc/X11/xinit/xinitrc
 +
 
 +
Next you need to create a new sessions preference to load the user file.
 +
 
 +
For Debian [lenny] go to System > Preferences > Sessions.
 +
Add a new startup program and add the command
 +
    sh /home/yourusername/.xinitrc
 +
click ok.
 +
 
 +
For Ubuntu use System > Preferences > Startup Applications.
 +
add the same startup program as above.
 +
 
 +
--[[User:Jeremy!|Jeremy!]] 14:49, 29 October 2009 (UTC)
 +
 
 +
==Screen rotation for X41 and X61 tablets==
 +
 
 +
[http://www.ziva-vatra.com/index.php?aid=56&id=U29mdHdhcmU= ROTgui - Python program for screen rotation].
 +
 
 +
The above is a simple program that you bind to a key (I bound it to the "rotate" button on the screen) that will let you rotate the screen 4 ways (90, 180, 270 and 0 degrees).
 +
 
 +
I prefer manually selecting when I want to rotate the screen because I don't want to accidentally rotate it while moving the laptop around.
 +
 
 +
The site says it's for an X41, but I can confirm that it works on my X61 as well! (Only tried on Ubuntu, but being a Python program, it should work on other OS-es as well).
 +
 
 +
The code also has a python module, that will allow you to script your own screen control, if you'd rather not use the GUI (or want to use keybindings/write your own interface on top of it).
 +
 
 +
--[[User:Ogi|Ogi]] 10:05, 6 November 2010 (UTC)
 +
 
 +
==xrandr Rotation==
 +
 
 +
There is work underway to create a [https://code.edge.launchpad.net/~karl.hegbloom/tabuntu/tablet-screen-rotation-support Tablet Screen Rotation Support] package for Ubuntu. Because I can afford only one tablet computer, and since this is relatively new and not many others have put any work into it yet, so far it mainly supports the Lenovo Thinkpad X61 Tablet. The next phase of development involves refactoring in such a way that it can easily be expanded to support other brands and models of tablet computer. The planned mechanism is similar to that used by the scripts in the Debian acpi-support package.
 +
 
 +
So far, it supports auto-rotation on conversion from laptop to tablet mode, including rebinding the navpad keys and turning the logical orientation of the Wacom tablet to match. It is done as an event called when the X Server has changed it's xRandR orientation. The actual work is carried out by a quick set of shell scripts that can easily be adapted and extended. The idea is that no matter what piece of software actually caused the X Server to rotate, the same things need to happen whenever it does. So the best place to hook in the support event is on an event handler for the RandR Rotate event. The programs and packaging are simple, and the source is available at the URL above. I encourage you to get a copy and learn from it while helping make it work for a new kind of tablet no other developer has created support for yet! If you can write an essay, you can write the necessary program.
 +
 
 +
Because this ThinkWiki page is one of the sources I drew from when I initially created tablet-screen-rotation-support. The following scripts by Gtx, radix, and Papertiger probably contain some elements in common.  --[[User:KarlHegbloom|KarlHegbloom]] 21:55, 9 February 2009 (UTC)
 +
 
 +
=== xrotate support scripts ===
 +
 
 +
linuxwacom is very buggy. I needed some time to get the tablet work with "xrandr -r". I use the script below to do screen rotation. copy the source an put it in /usr/local/bin/xrotate. You may change output and devices to fit to you're system (the default values work fine for an x41 tablet)
 +
 
 +
you can use "xrotate +" to rotate the screen CCW or "xrotate -" to rotate clockwise. use "xrotate x" where x is
 +
* 0 to set rotation to normal
 +
* 1 to set rotation to left
 +
* 2 to set rotation to inverted
 +
* 3 to set rotation to right
 +
 
 +
  #!/bin/sh
 +
 
 +
  output=LVDS
 +
  if [ "$XROT_OUTPUT" ]
 +
  then   
 +
          output=$XROT_OUTPUT;
 +
  fi
 +
  devices="stylus cursor"
 +
 
 +
  geomnbr=0
 +
  xrandr=normal
 +
  wacom=normal
 +
  if [ "$1" == "-" ] || [ "$1" == "+" ] || ! [ "$1" ];
 +
  then   
 +
          operator="$1";
 +
          [ "$1" ] || operator='+';
 +
          case `xrandr --verbose | grep "^$output " | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"` in
 +
                  normal)        geom=0;;
 +
                  left)          geom=1;;
 +
                  inverted)      geom=2;;
 +
                  right)          geom=3;;
 +
          esac
 +
          let geom=${geom}${operator}1+4
 +
          let geom=${geom}%4
 +
  else   
 +
          geom="$1"
 +
  fi
 +
 
 +
 
 +
  case $geom in
 +
          1)      wacom=2; xrandr=left ;;
 +
          2)      wacom=3; xrandr=inverted ;;
 +
          3)      wacom=1; xrandr=right ;;
 +
          *)      wacom=0; xrandr=normal ;;
 +
  esac
 +
 
 +
  echo "xrandr to $xrandr, xsetwacom to $wacom" >&2
 +
 
 +
  if xrandr --output "$output" --rotate "$xrandr"; then
 +
          for d in $devices
 +
          do     
 +
                  xsetwacom set "$device" Rotate "$wacom"
 +
          done
 +
  fi
 +
 
 +
  #workaround for linuxwacom bug
 +
  if [ "`xsetwacom get stylus Mode`" == '1' ]; then
 +
          for d in $devices
 +
          do     
 +
                  xsetwacom set stylus CoreEvent "off"
 +
                  xsetwacom set stylus Mode "off"
 +
          done
 +
          { sleep 1;
 +
          for d in $devices
 +
          do     
 +
                  xsetwacom set stylus Mode "on"
 +
                  xsetwacom set stylus CoreEvent "on"
 +
          done; } &
 +
  fi
 +
 
 +
--[[User:Gtx|Gtx]] 13:34, 22 April 2008 (CEST)
 +
 
 +
modified script for linuxwacom 0.8.1-1.
 +
 +
  #!/bin/sh
 +
 +
output="(normal left inverted right)" #LVDS
 +
  # if [ "$XROT_OUTPUT" ]
 +
  # then      
 +
  #        output=$XROT_OUTPUT;
 +
  # fi
 +
devices="stylus cursor"
 +
 +
geomnbr=0
 +
xrandr=normal
 +
wacom=normal
 +
if [ "$1" == "-" ] || [ "$1" == "+" ] || ! [ "$1" ];
 +
then   
 +
        operator="$1";
 +
        [ "$1" ] || operator='+';
 +
        case `xrandr --verbose | grep "$output" | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"` in
 +
                normal)        geom=0;;
 +
                left)          geom=1;;
 +
                inverted)      geom=2;;
 +
                right)          geom=3;;
 +
        esac
 +
        let geom=${geom}${operator}1+4
 +
        let geom=${geom}%4
 +
else   
 +
        geom="$1"
 +
fi
 +
case $geom in
 +
        1)      wacom=2; xrandr=left ;;
 +
        2)      wacom=3; xrandr=inverted ;;
 +
        3)      wacom=1; xrandr=right ;;
 +
        *)      wacom=0; xrandr=normal ;;
 +
esac
 +
 +
echo "xrandr to $xrandr, xsetwacom to $wacom" >&2
 +
 +
if xrandr -o "$xrandr"; then
 +
        for d in $devices
 +
        do     
 +
                xsetwacom set "stylus" Rotate "$wacom"
 +
        done
 +
fi
 +
 +
#workaround for linuxwacom bug
 +
if [ "`xsetwacom get stylus Mode`" == '1' ]; then
 +
        for d in $devices
 +
        do     
 +
                xsetwacom set stylus CoreEvent "off"
 +
                xsetwacom set stylus Mode "off"
 +
        done
 +
        { sleep 1;
 +
        for d in $devices
 +
        do     
 +
                xsetwacom set stylus Mode "on"
 +
                xsetwacom set stylus CoreEvent "on"
 +
        done; } &
 +
fi
 +
 
 +
 
 +
--[[User:radix|radix]] 13:15, 28 August 2008 (CEST)
 +
 
 +
Additional code for rotating the 4 navigation keys on the display frame.
 +
 
 +
<pre>
 +
key_up=111
 +
key_down=116
 +
key_left=113
 +
key_right=114
 +
 
 +
case $geom in
 +
        1)      xmodmap -e "keycode $key_up = Right";xmodmap -e "keycode $key_left = Up";xmodmap -e "keycode $key_right = Down";xmodmap -e "keycode $key_down = Left";;
 +
        2)      xmodmap -e "keycode $key_up = Down";xmodmap -e "keycode $key_left = Right";xmodmap -e "keycode $key_right = Left";xmodmap -e "keycode $key_down = Up";;
 +
        3)      xmodmap -e "keycode $key_up = Left";xmodmap -e "keycode $key_left = Down";xmodmap -e "keycode $key_right = Up";xmodmap -e "keycode $key_down = Right";;
 +
        *)      xmodmap -e "keycode $key_up = Up";xmodmap -e "keycode $key_left = Left";xmodmap -e "keycode $key_right = Right";xmodmap -e "keycode $key_down = Down";;
 +
esac
 +
</pre>
 +
--[[User:Papertiger|Papertiger]] 22:24, 12 March 2010 (UTC)
 +
 
 +
 
 +
=== modified script ===
 +
On my X200 Tablet i have a "invert" tablet button and a "flip" button, so i modified the the script for my needs. This scripts also works with xrandr program version 1.3.2 and xsetwacom 0.10.3 under Debian Testing (Squeeze). You can call the script with "./tablet.sh flip" or "./tablet.sh invert". I mapped these two functions on the hardware buttons. The full Tutorial can be found on my blog: http://dominikschuermann.de/index.php/2010/05/thinkpad-x200-tablet-for-debian-testing/
 +
 
 +
<pre>
 +
#!/bin/bash
 +
 
 +
# config
 +
output="LVDS1"
 +
 
 +
# get current rotation
 +
current=`xrandr --verbose | grep "$output" | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"`
 +
case $current in
 +
  normal)    geom=0;;
 +
  left)      geom=1;;
 +
  inverted)  geom=2;;
 +
  right)    geom=3;;
 +
esac
 +
 
 +
if [ "$1" == "invert" ] || [ "$1" == "flip" ];
 +
then
 +
 
 +
 
 +
  # based on current rotation set new rotation
 +
  if [ "$1" == "invert" ];
 +
  then
 +
 
 +
    # invert
 +
    case $geom in
 +
      0)  wacom=half; xrandr=inverted;;
 +
      1)  wacom=cw; xrandr=right;;
 +
      2)  wacom=none; xrandr=normal;;
 +
      3)  wacom=ccw; xrandr=left;;
 +
    esac
 +
 
 +
  else
 +
   
 +
    # flip
 +
    case $geom in
 +
      0)  wacom=cw; xrandr=right;;
 +
      1)  wacom=half; xrandr=inverted;;
 +
      2)  wacom=ccw; xrandr=left;;
 +
      3)  wacom=none; xrandr=normal;;
 +
     esac
 +
 
 +
  fi
 +
 
 +
 
 +
 
 +
  echo "xrandr to $xrandr, xsetwacom to $wacom" >&2
 +
 
 +
  # rotate display
 +
  xrandr -o $xrandr
 +
 
 +
  # rotate wacom
 +
  xsetwacom set "stylus" Rotate $wacom
 +
  xsetwacom set "eraser" Rotate $wacom
 +
  xsetwacom set "touch" Rotate $wacom
 +
 
 +
else
 +
 
 +
  echo "possible parameters: flip, invert"
 +
 +
fi
 +
 
 +
</pre>
 +
--[[User:Dominiks|Dominiks]] 18:47, 17 April 2010 (UTC)
 +
 
 +
=== another modified script (X41) ===
 +
I'm using this script to rotate the screen on my X41 (1866-WG4). The rotation is either absolute using the arguments ''normal'', ''inverted'', ''left'' and ''right'' or relative to the current orientation using ''cw'' or ''ccw''.
 +
 
 +
<pre>
 +
  #!/bin/sh
 +
 
 +
  xrandr=normal
 +
  wacom=NONE
 +
 
 +
  case "$1" in
 +
  normal)
 +
  xrandr=normal
 +
  wacom=NONE
 +
  ;;
 +
  inverted)
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  ;;
 +
  right)
 +
  xrandr=right
 +
  wacom=CW
 +
  ;;
 +
  left)
 +
  xrandr=left
 +
  wacom=CCW
 +
  ;;
 +
  cw|ccw)
 +
  case `xrandr --verbose -q -o normal --dryrun | grep "Current rotation" | sed "s/Current\ rotation\ \-\ //g"` in
 +
  normal)
 +
  if [ "$1" = "cw" ]; then
 +
  xrandr=right
 +
  wacom=CW
 +
  else
 +
  xrandr=left
 +
  wacom=CCW
 +
  fi
 +
  ;;
 +
  left)
 +
  if [ "$1" = "cw" ]; then
 +
  xrand=normal
 +
  wacom=NONE
 +
  else
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  fi
 +
  ;;
 +
  inverted)
 +
  if [ "$1" = "cw" ]; then
 +
  xrandr=left
 +
  wacom=CCW
 +
  else
 +
  xrandr=right
 +
  wacom=CW
 +
  fi
 +
  ;;
 +
  right)
 +
  if [ "$1" = "cw" ]; then
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  else
 +
  xrandr=normal
 +
  wacom=NONE
 +
  fi
 +
  ;;
 +
  esac
 +
  ;;
 +
  *)
 +
  echo "Usage: $0 {normal|left|right|inverted|cw|ccw}"
 +
  exit 1
 +
  ;;
 +
  esac
 +
 
 +
  if xrandr --output LVDS1 --rotate "$xrandr"; then
 +
  xsetwacom --set stylus0 Rotate "$wacom"
 +
  xsetwacom --set cursor0 Rotate "$wacom"
 +
  xsetwacom --set eraser0 Rotate "$wacom"
 +
  exit 0
 +
  fi
 +
 
 +
  exit 1
 +
</pre>
 +
 
 +
You will have to change lines 69 to 73 to suit your configuration. ''LVDS1'' is the laptop screen as returned by xrandr; ''stylus0'', ''cursor0'' and ''eraser0'' are what I have called the wacom devices in my xorg.conf.
 +
The software I'm using on my X41 is the following:
 +
 
 +
<pre>
 +
  $ xrandr -v
 +
  xrandr program version      1.3.3
 +
  Server reports RandR version 1.3
 +
 
 +
  $ xsetwacom -V
 +
  0.10.5
 +
</pre>
 +
 
 +
I am using the ''intel'' driver for the graphics adapter; unfortunately, display rotation is <u>not</u> possible with the kernel's intel framebuffer driver and Xorg's ''fbdev''. Both xrandr and xsetwacom were installed from debian sid repositories, xsetwacom came with the ''xserver-xorg-input-wacom'' package, <u>not ''wacom-tools''</u>.
 +
 
 +
--[[User:mk|mk]] 16.51, 6 August 2010 (CEST)
 +
 
 +
 
 +
=== X41 tablet with UBUNTU 10.10 ===
 +
 
 +
On my thinkpad X41 tablet with Ubuntu 10.10 i got this message with the previous script:
 +
<pre>
 +
Cannot find device 'stylus0'.
 +
Cannot find device 'cursor0'.
 +
Cannot find device 'eraser0'
 +
</pre>
 +
 
 +
In order to get it work I had to change this script a little bit (I didn't need to change or create an "xorg.conf" or anything else, I only used this script):
 +
 
 +
1. Type in a terminal: {{cmduser|xinput}}:
 +
<pre>
 +
maxi@maxi-ThinkPad-X41-Tablet:~$ xinput --list
 +
⎡ Virtual core pointer                    id=2 [master pointer  (3)]
 +
⎜  ↳ Virtual core XTEST pointer              id=4 [slave  pointer  (2)]
 +
⎜  ↳ TPPS/2 IBM TrackPoint                  id=10 [slave  pointer  (2)]
 +
⎜  ↳ Serial Wacom Tablet eraser              id=12 [slave  pointer  (2)]
 +
⎜  ↳ Serial Wacom Tablet stylus              id=13 [slave  pointer  (2)]
 +
⎣ Virtual core keyboard                  id=3 [master keyboard (2)]
 +
    ↳ Virtual core XTEST keyboard            id=5 [slave  keyboard (3)]
 +
    ↳ Power Button                            id=6 [slave  keyboard (3)]
 +
    ↳ Video Bus                              id=7 [slave  keyboard (3)]
 +
    ↳ Sleep Button                            id=8 [slave  keyboard (3)]
 +
    ↳ AT Translated Set 2 keyboard            id=9 [slave  keyboard (3)]
 +
    ↳ ThinkPad Extra Buttons                  id=11 [slave  keyboard (3)]
 +
maxi@maxi-ThinkPad-X41-Tablet:~$
 +
</pre>
 +
So you know the id numbers of your Eraser (12) and Stylus (13)
 +
 
 +
2. Modify the script given in this article: Instead of "Eraser" and "Stylus" use your id-numbers:
 +
Change
 +
<pre>
 +
  if xrandr --output LVDS1 --rotate "$xrandr"; then
 +
  xsetwacom --set stylus0 Rotate "$wacom"
 +
  xsetwacom --set cursor0 Rotate "$wacom"
 +
  xsetwacom --set eraser0 Rotate "$wacom"
 +
  exit 0
 +
  fi
 +
</pre>
 +
 
 +
into
 +
 
 +
<pre>
 +
  if xrandr --output LVDS1 --rotate "$xrandr"; then
 +
  xsetwacom --set 13 Rotate "$wacom"
 +
#  xsetwacom --set cursor0 Rotate "$wacom"
 +
  xsetwacom --set 12 Rotate "$wacom"
 +
  exit 0
 +
  fi
 +
</pre>
 +
 
 +
So in total, you should have the following script saved in a file (for example xrandr in your homefolder /home/"username")
 +
 
 +
<pre>
 +
#!/bin/sh
 +
 
 +
  xrandr=normal
 +
  wacom=NONE
 +
 
 +
  case "$1" in
 +
  normal)
 +
  xrandr=normal
 +
  wacom=NONE
 +
  ;;
 +
  inverted)
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  ;;
 +
  right)
 +
  xrandr=right
 +
  wacom=CW
 +
  ;;
 +
  left)
 +
  xrandr=left
 +
  wacom=CCW
 +
  ;;
 +
  cw|ccw)
 +
  case `xrandr --verbose -q -o normal --dryrun | grep "Current rotation" | sed "s/Current\ rotation\ \-\ //g"` in
 +
  normal)
 +
  if [ "$1" = "cw" ]; then
 +
  xrandr=right
 +
  wacom=CW
 +
  else
 +
  xrandr=left
 +
  wacom=CCW
 +
  fi
 +
  ;;
 +
  left)
 +
  if [ "$1" = "cw" ]; then
 +
  xrand=normal
 +
  wacom=NONE
 +
  else
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  fi
 +
  ;;
 +
  inverted)
 +
  if [ "$1" = "cw" ]; then
 +
  xrandr=left
 +
  wacom=CCW
 +
  else
 +
  xrandr=right
 +
  wacom=CW
 +
  fi
 +
  ;;
 +
  right)
 +
  if [ "$1" = "cw" ]; then
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  else
 +
  xrandr=normal
 +
  wacom=NONE
 +
  fi
 +
  ;;
 +
  esac
 +
  ;;
 +
  *)
 +
  echo "Usage: $0 {normal|left|right|inverted|cw|ccw}"
 +
  exit 1
 +
  ;;
 +
  esac
 +
 
 +
  if xrandr --output LVDS1 --rotate "$xrandr"; then
 +
  xsetwacom --set 13 Rotate "$wacom"
 +
#  xsetwacom --set cursor Rotate "$wacom"
 +
  xsetwacom --set 12 Rotate "$wacom"
 +
  exit 0
 +
  fi
 +
 
 +
  exit 1
 +
</pre>
 +
 
 +
After you saved it as "xrandr", open a terminal, go to the folder, in which you saved "xrandr", and type
 +
{{cmduser|chmod +x xrandr}}
 +
 
 +
in order to be able to use this script with typing in an terminal
 +
{{cmduser|./xrandr right}} for right rotation and {{cmduser|./xrandr normal}} for left.
 +
 
 +
--[[User:klob]] 11.40, 24 October 2010 (CEST)
 +
 
 +
 
 +
If you want to easily switch between two orientations, you can use the following script. You can assign this script to the corresponding button on the tablet. It os working on my Thinkpad X61 tablet. If you remove the "yes" after flipflop= the script works as the script above.
 +
 
 +
<pre>
 +
#!/bin/sh
 +
 
 +
#
 +
# wether to run in flipflop-Mode. Leave blank if not.
 +
# In flipflop mode you can easily switch between two preferred orientations.
 +
#
 +
flipflop=yes
 +
 
 +
 
 +
 
 +
par=$1
 +
semaphore=/tmp/rotate.sem
 +
if [ -n "$flipflop" ]; then
 +
  # only if variable $flipflop is set
 +
  if [ -f $semaphore ]; then
 +
    # semaphore exists
 +
    rm $semaphore
 +
    par=normal
 +
  else
 +
    # semaphore dont exist -> create it
 +
    touch $semaphore
 +
    par=right
 +
  fi
 +
fi
 +
 
 +
 
 +
 
 +
  xrandr=normal
 +
  wacom=NONE
 +
 
 +
  case "$par" in
 +
  normal)
 +
  xrandr=normal
 +
  wacom=NONE
 +
  ;;
 +
  inverted)
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  ;;
 +
  right)
 +
  xrandr=right
 +
  wacom=CW
 +
  ;;
 +
  left)
 +
  xrandr=left
 +
  wacom=CCW
 +
  ;;
 +
  cw|ccw)
 +
  case `xrandr --verbose -q -o normal --dryrun | grep "Current rotation" | sed "s/Current\ rotation\ \-\ //g"` in
 +
  normal)
 +
  if [ "$par" = "cw" ]; then
 +
  xrandr=right
 +
  wacom=CW
 +
  else
 +
  xrandr=left
 +
  wacom=CCW
 +
  fi
 +
  ;;
 +
  left)
 +
  if [ "$par" = "cw" ]; then
 +
  xrand=normal
 +
  wacom=NONE
 +
  else
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  fi
 +
  ;;
 +
  inverted)
 +
  if [ "$par" = "cw" ]; then
 +
  xrandr=left
 +
  wacom=CCW
 +
  else
 +
  xrandr=right
 +
  wacom=CW
 +
  fi
 +
  ;;
 +
  right)
 +
  if [ "$par" = "cw" ]; then
 +
  xrandr=inverted
 +
  wacom=HALF
 +
  else
 +
  xrandr=normal
 +
  wacom=NONE
 +
  fi
 +
  ;;
 +
  esac
 +
  ;;
 +
  *)
 +
  echo $flipflop
 +
  if [ -z $flipflop ]; then
 +
  # only if variable flipflop is not set
 +
  echo "Usage: $0 {normal|left|right|inverted|cw|ccw}"
 +
  exit 1
 +
  fi
 +
  ;;
 +
  esac
 +
 
 +
  if xrandr --output LVDS1 --rotate "$xrandr"; then
 +
  xsetwacom --set 13 Rotate "$wacom"
 +
#  xsetwacom --set cursor Rotate "$wacom"
 +
  xsetwacom --set 12 Rotate "$wacom"
 +
  exit 0
 +
  fi
 +
 
 +
  exit 1
 +
</pre>
 +
--[[User:dcjfm]] 10.20, 23 November 2010 (CEST):
 +
 
 +
==Troubleshooting==
 +
 
 +
If the stylus still doesn't work try to reset the bios. This fixed it for me. --[[User:Gtx|Gtx]] 08:22, 21 April 2008 (CEST)
 +
 
 +
Ubuntu 11.10 (Oneiric Ocelot):
 +
Per the thread at [http://ubuntuforums.org/showthread.php?t=1862595 Ubuntuforums], comment out or remove /lib/udev/rules.d/40-inputattach.rules to get the stylus functioning.
  
==Models featuring this Device==
+
[https://launchpad.net/magick-rotation Magick-Rotation] is useful for auto-rotating the screen  but may require switching the cw / ccw notations to match the stylus orientation to that of the screen ([https://answers.launchpad.net/magick-rotation/+question/174153 bug]). --[[User:wseltzer|wseltzer]]
*ThinkPad {{X41_Tablet}}
 
*ThinkPad {{X60_Tablet}}
 
*ThinkPad {{X61_Tablet}}
 
  
[[Category:Components]]
+
[[Category:ThinkPad Technologies]]

Latest revision as of 16:02, 22 January 2021

ThinkPad and other portable computers have integrated Wacom digitiser technology since at least 1994 ThinkPad 730T. 730T 730TE During the years of Windows XP Tablet PC Edition, Wacom marketed the technology as 'Wacom Penabled'.

ThinkPad X41 Tablet Digitizer Pen

stock picture of ThinkPad X41 Tablet Digitizer Pen The ThinkPad X41 Tablet Digitizer Pen has red tips, a pocket clip, dual side-switch, no eraser. It fits in the X41 Tablet pen storage area.

part numbers

  • Wacom model UP-814-54A
  • Marketing part number 73P5188
    • FRU P/N 39T0803 (replaced by 39T7303)
    • IBM P/N 39T7302, FRU P/N 39T7303
    • UPC 000435611079, EAN 5050689611078, JAN 4560209481797

documentation


ThinkPad Tablet Digitizer Pen

This generic-sounding pen has a red tip, single side-switch, grey eraser, and pocket clip. It was first used with X60 Tablet, but it fits in the pen storage area also for the following systems: ThinkPad X60 Tablet, X61 Tablet, X200 Tablet, X201 Tablet, W700, W700ds, W701, W701ds.

part numbers

  • Marketing part number 41U3143
    • Lenovo P/N: 39T7481, FRU P/N: 39T7482
    • Lenovo P/N: 45N2630, FRU P/N: 45N2631
  • ThinkPad Tablet Tether 3-pack: 41U4820
    • UPC 882861963942, EAN 0882861963942, JAN 4560209531621

documentation

ThinkPad X200 Tablet Pen and Touch

This tablet uses a serial connection for the stylus and touch screen. If you'd like to see raw output from it, type: cat /dev/ttyS0 CTRL-C to stop. If your terminal is corrupted, type 'reset' and press Enter.

systemd

  • You need the inputattach program. This may be part of a joystick package on your system. In Gentoo, it is part of games-util/joystick.
  • You can test inputattach by running:
inputattach --w8001 /dev/ttyS0

Now try to touch the screen with your finger or either end of the stylus. This is blocking. Press CTRL-C to stop it.

  • To have this mapping occur automatically, create /etc/systemd/system/wacom-serial.service
[Unit]
Description=Tie Wacom Serial Device to XInput

[Service]
ExecStart=/usr/bin/inputattach --w8001 /dev/ttyS0

[Install]
WantedBy=multi-user.target
  • Enable the new script in systemd.
systemctl enable wacom-serial
  • If you're not rebooting, start the new service.
systemctl start wacom-serial
  • You should see an input for touch, pen, and eraser if you run 'xinput':
TODO


ThinkPad X220 Tablet Digitiser Pen

The ThinkPad X220 Tablet pen has a black tip, single side-switch, red eraser, and pocket clip. This colour option is also used in X230 Tablet

part numbers

    • Lenovo P/N: 0A72243, FRU P/N: 04W1477
    • Lenovo P/N: 0B42547

documentation


ThinkPad X1 Yoga Digitizer Pen

The ThinkPad X1 Yoga pen has a black tip and two side buttons (one is for the eraser). The laptop comes with the pen by default and has a pen slot on the side.

part numbers

  • Wacom ActPen, TP, 6.5mm
    • Lenovo FRU P/N: 00HN897

Linux Support

The pen is supported by the XFree/Xorg Wacom driver. New tablets also have the MultiTouch capability. MultiTouch is experimentally supported presently by the Linux wacom project. The pen works regardless of MultiTouch support.

Wacom Serial Tablet PC Stylus

This is a stylus made for tablet PCs by Wacom.

Features

  • Chipset: Wacom
  • Serial: irq 5 port 0x0200

First steps

Get the linux wacom driver and install it on your system.

The pen uses serial and appears on some /dev/ttySnn device where nn is a number. An easy way to find it is to map /dev/ttyS0 to the pen's port and irq. The values can be found under the windows driver properties. Using values from an X41 Tablet 1869-5CU, the command is: # setserial /dev/ttyS0 port 0x0200 irq 5 autoconfig (you need to run this after every suspend/resume cycle).

This may be inserted into startup scripts in /etc/rc.d/ or /etc/rc.local

After mapping the pen, you can check its output with # wacdump -f tpc /dev/ttyS0. This will list raw information about the pens position an click status. Hit Ctrl+C to exit wacdump.

Setting up your Xorg.conf

X-Server >= 1.8 (udev)

since X-Server 1.8 udev is the default way to detect any wacom-tablet. on some distributions you have to add the file /etc/udev/rules.d/10-wacom.rules with following content:

   ACTION!="add|change", GOTO="wacom_end"
    # 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"

and /usr/share/X11/xorg.conf.d/50-wacom:

   Section "InputClass"
       Identifier "Wacom serial class identifiers"
       MatchProduct "WACf|WACf004|FUJ02e5|FUJ02e7"
       Driver "wacom"
   EndSection

thanks to the Wacom Tablet - ArchWikipage and this Archlinux-Thread

X-Server >=1.6? (hal)

if HAL is configured as it should be, your wacom-tablet is working out of the box

older X-Server (static configuration)

If you are sure, you don't want to update to a newer version, add the following sections to your xorg.conf:

   Section "InputDevice"
     Driver        "wacom"
     Identifier    "cursor"
     Option        "Device"        "/dev/ttyS0"
     Option        "Type"          "cursor"
     Option        "ForceDevice"   "ISDV4"     
     Option        "Mode"          "Absolute"
   EndSection
   
   Section "InputDevice"
     Driver        "wacom"
     Identifier    "stylus"
     Option        "Device"        "/dev/ttyS0"
     Option        "Type"          "stylus"
     Option        "ForceDevice"   "ISDV4"
   EndSection
   
   Section "InputDevice"
     Driver        "wacom"
     Identifier    "eraser"
     Option        "Device"        "/dev/ttyS0"
     Option        "Type"          "eraser"
     Option        "ForceDevice"   "ISDV4"
   EndSection
   # support for "touch" (with finger, available on x200t and some x61t)
  Section "InputDevice"
    Driver        "wacom"
    Identifier    "touch"
    Option        "Device"        "/dev/ttyS0"          # SERIAL ONLY
    Option        "Type"          "touch"
    Option        "ForceDevice"   "ISDV4"               # Serial Tablet PC ONLY
  EndSection
  Section "ServerLayout"
    Identifier     "Default Layout"
    Screen 0 "Default Screen"   0 0
    InputDevice    "Configured Mouse"    "CorePointer"
    InputDevice    "cursor" "SendCoreEvents"
    InputDevice    "stylus" "SendCoreEvents"
    InputDevice    "eraser" "SendCoreEvents"
    #InputDevice   "touch"  "SendCoreEvents" #Uncomment if you have this feature.
  EndSection

Check the wacom driver man page and website for other options.

For handwriting recognition using pen you can use CellWriter.

To get the right mouse button to map to the stylus button use this script and run it through .bashrc

   #!/bin/bash
   xsetwacom set stylus Button1 1
   xsetwacom set stylus Button2 3
   xsetwacom set stylus Button3 3

Wacomcpl

I found it useful to create a .desktop file for launching the wacomcpl program which is used for many user options for the tablet pen.

   [Desktop Entry]
   Type=Application
   Encoding=UTF-8
   Name=wacomcpl
   GenericName=linux wacom config
   Comment=linux wacom configuration tool
   TryExec=wacomcpl
   Exec=wacomcpl
   Terminal=false
   Categories=System;
   Icon=wacomcpl.png

To have your settings restore after logout/suspend/restart you will need to edit /home/yourusername/.xinitrc. Go to the last line and change

   . /etc/X11/xinit/xinitrc

to read as

   # . /etc/X11/xinit/xinitrc

Next you need to create a new sessions preference to load the user file.

For Debian [lenny] go to System > Preferences > Sessions. Add a new startup program and add the command

   sh /home/yourusername/.xinitrc

click ok.

For Ubuntu use System > Preferences > Startup Applications. add the same startup program as above.

--Jeremy! 14:49, 29 October 2009 (UTC)

Screen rotation for X41 and X61 tablets

ROTgui - Python program for screen rotation.

The above is a simple program that you bind to a key (I bound it to the "rotate" button on the screen) that will let you rotate the screen 4 ways (90, 180, 270 and 0 degrees).

I prefer manually selecting when I want to rotate the screen because I don't want to accidentally rotate it while moving the laptop around.

The site says it's for an X41, but I can confirm that it works on my X61 as well! (Only tried on Ubuntu, but being a Python program, it should work on other OS-es as well).

The code also has a python module, that will allow you to script your own screen control, if you'd rather not use the GUI (or want to use keybindings/write your own interface on top of it).

--Ogi 10:05, 6 November 2010 (UTC)

xrandr Rotation

There is work underway to create a Tablet Screen Rotation Support package for Ubuntu. Because I can afford only one tablet computer, and since this is relatively new and not many others have put any work into it yet, so far it mainly supports the Lenovo Thinkpad X61 Tablet. The next phase of development involves refactoring in such a way that it can easily be expanded to support other brands and models of tablet computer. The planned mechanism is similar to that used by the scripts in the Debian acpi-support package.

So far, it supports auto-rotation on conversion from laptop to tablet mode, including rebinding the navpad keys and turning the logical orientation of the Wacom tablet to match. It is done as an event called when the X Server has changed it's xRandR orientation. The actual work is carried out by a quick set of shell scripts that can easily be adapted and extended. The idea is that no matter what piece of software actually caused the X Server to rotate, the same things need to happen whenever it does. So the best place to hook in the support event is on an event handler for the RandR Rotate event. The programs and packaging are simple, and the source is available at the URL above. I encourage you to get a copy and learn from it while helping make it work for a new kind of tablet no other developer has created support for yet! If you can write an essay, you can write the necessary program.

Because this ThinkWiki page is one of the sources I drew from when I initially created tablet-screen-rotation-support. The following scripts by Gtx, radix, and Papertiger probably contain some elements in common. --KarlHegbloom 21:55, 9 February 2009 (UTC)

xrotate support scripts

linuxwacom is very buggy. I needed some time to get the tablet work with "xrandr -r". I use the script below to do screen rotation. copy the source an put it in /usr/local/bin/xrotate. You may change output and devices to fit to you're system (the default values work fine for an x41 tablet)

you can use "xrotate +" to rotate the screen CCW or "xrotate -" to rotate clockwise. use "xrotate x" where x is

  • 0 to set rotation to normal
  • 1 to set rotation to left
  • 2 to set rotation to inverted
  • 3 to set rotation to right
 #!/bin/sh
 
 output=LVDS
 if [ "$XROT_OUTPUT" ]
 then    
         output=$XROT_OUTPUT;
 fi
 devices="stylus cursor"
 
 geomnbr=0
 xrandr=normal
 wacom=normal
 if [ "$1" == "-" ] || [ "$1" == "+" ] || ! [ "$1" ];
 then    
         operator="$1";
         [ "$1" ] || operator='+';
         case `xrandr --verbose | grep "^$output " | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"` in
                 normal)         geom=0;;
                 left)           geom=1;;
                 inverted)       geom=2;;
                 right)          geom=3;;
         esac
         let geom=${geom}${operator}1+4
         let geom=${geom}%4
 else    
         geom="$1"
 fi
 
 
 case $geom in
         1)      wacom=2; xrandr=left ;;
         2)      wacom=3; xrandr=inverted ;;
         3)      wacom=1; xrandr=right ;;
         *)      wacom=0; xrandr=normal ;;
 esac
 
 echo "xrandr to $xrandr, xsetwacom to $wacom" >&2
 
 if xrandr --output "$output" --rotate "$xrandr"; then
         for d in $devices
         do      
                 xsetwacom set "$device" Rotate "$wacom"
         done
 fi
 
 #workaround for linuxwacom bug
 if [ "`xsetwacom get stylus Mode`" == '1' ]; then
         for d in $devices
         do      
                 xsetwacom set stylus CoreEvent "off"
                 xsetwacom set stylus Mode "off"
         done
         { sleep 1;
         for d in $devices
         do      
                 xsetwacom set stylus Mode "on"
                 xsetwacom set stylus CoreEvent "on"
         done; } &
 fi

--Gtx 13:34, 22 April 2008 (CEST)

modified script for linuxwacom 0.8.1-1.

  #!/bin/sh

output="(normal left inverted right)" #LVDS
 # if [ "$XROT_OUTPUT" ]
 # then     
 #         output=$XROT_OUTPUT;
 # fi
devices="stylus cursor"

geomnbr=0
xrandr=normal
wacom=normal
if [ "$1" == "-" ] || [ "$1" == "+" ] || ! [ "$1" ];
then    
        operator="$1";
        [ "$1" ] || operator='+';
        case `xrandr --verbose | grep "$output" | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"` in
                normal)         geom=0;;
                left)          geom=1;;
                inverted)       geom=2;;
                right)          geom=3;;
        esac
        let geom=${geom}${operator}1+4
        let geom=${geom}%4	
else    
        geom="$1"
fi
case $geom in
        1)      wacom=2; xrandr=left ;;
        2)      wacom=3; xrandr=inverted ;;
        3)      wacom=1; xrandr=right ;;
        *)      wacom=0; xrandr=normal ;;
esac

echo "xrandr to $xrandr, xsetwacom to $wacom" >&2

if xrandr -o "$xrandr"; then
        for d in $devices
        do      
                xsetwacom set "stylus" Rotate "$wacom"
        done
fi

#workaround for linuxwacom bug
if [ "`xsetwacom get stylus Mode`" == '1' ]; then
        for d in $devices
        do      
                xsetwacom set stylus CoreEvent "off"
                xsetwacom set stylus Mode "off"
        done
        { sleep 1;
        for d in $devices
        do      
                xsetwacom set stylus Mode "on"
                xsetwacom set stylus CoreEvent "on"
        done; } &
fi


--radix 13:15, 28 August 2008 (CEST)

Additional code for rotating the 4 navigation keys on the display frame.

 key_up=111
 key_down=116
 key_left=113
 key_right=114

 case $geom in
         1)      xmodmap -e "keycode $key_up = Right";xmodmap -e "keycode $key_left = Up";xmodmap -e "keycode $key_right = Down";xmodmap -e "keycode $key_down = Left";;
         2)      xmodmap -e "keycode $key_up = Down";xmodmap -e "keycode $key_left = Right";xmodmap -e "keycode $key_right = Left";xmodmap -e "keycode $key_down = Up";;
         3)      xmodmap -e "keycode $key_up = Left";xmodmap -e "keycode $key_left = Down";xmodmap -e "keycode $key_right = Up";xmodmap -e "keycode $key_down = Right";;
         *)      xmodmap -e "keycode $key_up = Up";xmodmap -e "keycode $key_left = Left";xmodmap -e "keycode $key_right = Right";xmodmap -e "keycode $key_down = Down";;
 esac

--Papertiger 22:24, 12 March 2010 (UTC)


modified script

On my X200 Tablet i have a "invert" tablet button and a "flip" button, so i modified the the script for my needs. This scripts also works with xrandr program version 1.3.2 and xsetwacom 0.10.3 under Debian Testing (Squeeze). You can call the script with "./tablet.sh flip" or "./tablet.sh invert". I mapped these two functions on the hardware buttons. The full Tutorial can be found on my blog: http://dominikschuermann.de/index.php/2010/05/thinkpad-x200-tablet-for-debian-testing/

#!/bin/bash

# config
output="LVDS1"

# get current rotation
current=`xrandr --verbose | grep "$output" | sed "s/^[^ ]* [^ ]* [^ ]* ([^(]*) \([a-z]*\).*/\1/"`
case $current in
  normal)    geom=0;;
  left)      geom=1;;
  inverted)  geom=2;;
  right)     geom=3;;
esac

if [ "$1" == "invert" ] || [ "$1" == "flip" ];
then


  # based on current rotation set new rotation
  if [ "$1" == "invert" ];
  then
  
    # invert
    case $geom in
      0)  wacom=half; xrandr=inverted;;
      1)  wacom=cw; xrandr=right;;
      2)  wacom=none; xrandr=normal;;
      3)  wacom=ccw; xrandr=left;;
    esac

  else
    
    # flip
    case $geom in
      0)  wacom=cw; xrandr=right;;
      1)  wacom=half; xrandr=inverted;;
      2)  wacom=ccw; xrandr=left;;
      3)  wacom=none; xrandr=normal;;
    esac

  fi



  echo "xrandr to $xrandr, xsetwacom to $wacom" >&2

  # rotate display
  xrandr -o $xrandr

  # rotate wacom
  xsetwacom set "stylus" Rotate $wacom
  xsetwacom set "eraser" Rotate $wacom
  xsetwacom set "touch" Rotate $wacom

else

  echo "possible parameters: flip, invert"
 
fi

--Dominiks 18:47, 17 April 2010 (UTC)

another modified script (X41)

I'm using this script to rotate the screen on my X41 (1866-WG4). The rotation is either absolute using the arguments normal, inverted, left and right or relative to the current orientation using cw or ccw.

  #!/bin/sh
  
  xrandr=normal
  wacom=NONE
  
  case "$1" in
  	normal)
  		xrandr=normal
  		wacom=NONE
  		;;
  	inverted)
  		xrandr=inverted
  		wacom=HALF
  		;;
  	right)
  		xrandr=right
  		wacom=CW
  		;;
  	left)
  		xrandr=left
  		wacom=CCW
  		;;
  	cw|ccw)
  		case `xrandr --verbose -q -o normal --dryrun | grep "Current rotation" | sed "s/Current\ rotation\ \-\ //g"` in
  			normal)
  				if [ "$1" = "cw" ]; then
  					xrandr=right
  					wacom=CW
  				else
  					xrandr=left
  					wacom=CCW
  				fi
  				;;
  			left)
  				if [ "$1" = "cw" ]; then
  					xrand=normal
  					wacom=NONE
  				else
  					xrandr=inverted
  					wacom=HALF
  				fi
  				;;
  			inverted)
  				if [ "$1" = "cw" ]; then
  					xrandr=left
  					wacom=CCW
  				else
  					xrandr=right
  					wacom=CW
  				fi
  				;;
  			right)
  				if [ "$1" = "cw" ]; then
  					xrandr=inverted
  					wacom=HALF
  				else
  					xrandr=normal
  					wacom=NONE
  				fi
  				;;
  		esac
  		;;
  	*)
  		echo "Usage: $0 {normal|left|right|inverted|cw|ccw}"
  		exit 1
  		;;
  esac
   
  if xrandr --output LVDS1 --rotate "$xrandr"; then
  	xsetwacom --set stylus0 Rotate "$wacom"
  	xsetwacom --set cursor0 Rotate "$wacom"
  	xsetwacom --set eraser0 Rotate "$wacom"
  	exit 0
  fi
  
  exit 1

You will have to change lines 69 to 73 to suit your configuration. LVDS1 is the laptop screen as returned by xrandr; stylus0, cursor0 and eraser0 are what I have called the wacom devices in my xorg.conf. The software I'm using on my X41 is the following:

  $ xrandr -v
  xrandr program version       1.3.3
  Server reports RandR version 1.3
  
  $ xsetwacom -V
  0.10.5

I am using the intel driver for the graphics adapter; unfortunately, display rotation is not possible with the kernel's intel framebuffer driver and Xorg's fbdev. Both xrandr and xsetwacom were installed from debian sid repositories, xsetwacom came with the xserver-xorg-input-wacom package, not wacom-tools.

--mk 16.51, 6 August 2010 (CEST)


X41 tablet with UBUNTU 10.10

On my thinkpad X41 tablet with Ubuntu 10.10 i got this message with the previous script:

Cannot find device 'stylus0'.
Cannot find device 'cursor0'.
Cannot find device 'eraser0'

In order to get it work I had to change this script a little bit (I didn't need to change or create an "xorg.conf" or anything else, I only used this script):

1. Type in a terminal: $ xinput:

maxi@maxi-ThinkPad-X41-Tablet:~$ xinput --list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                   	id=10	[slave  pointer  (2)]
⎜   ↳ Serial Wacom Tablet eraser              	id=12	[slave  pointer  (2)]
⎜   ↳ Serial Wacom Tablet stylus              	id=13	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=8	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=9	[slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                  	id=11	[slave  keyboard (3)]
maxi@maxi-ThinkPad-X41-Tablet:~$

So you know the id numbers of your Eraser (12) and Stylus (13)

2. Modify the script given in this article: Instead of "Eraser" and "Stylus" use your id-numbers: Change

  if xrandr --output LVDS1 --rotate "$xrandr"; then
  	xsetwacom --set stylus0 Rotate "$wacom"
  	xsetwacom --set cursor0 Rotate "$wacom"
  	xsetwacom --set eraser0 Rotate "$wacom"
  	exit 0
  fi

into

  if xrandr --output LVDS1 --rotate "$xrandr"; then
  	xsetwacom --set 13 Rotate "$wacom"
#  	xsetwacom --set cursor0 Rotate "$wacom"
  	xsetwacom --set 12 Rotate "$wacom"
  	exit 0
  fi

So in total, you should have the following script saved in a file (for example xrandr in your homefolder /home/"username")

#!/bin/sh
  
  xrandr=normal
  wacom=NONE
  
  case "$1" in
  	normal)
  		xrandr=normal
  		wacom=NONE
  		;;
  	inverted)
  		xrandr=inverted
  		wacom=HALF
  		;;
  	right)
  		xrandr=right
  		wacom=CW
  		;;
  	left)
  		xrandr=left
  		wacom=CCW
  		;;
  	cw|ccw)
  		case `xrandr --verbose -q -o normal --dryrun | grep "Current rotation" | sed "s/Current\ rotation\ \-\ //g"` in
  			normal)
  				if [ "$1" = "cw" ]; then
  					xrandr=right
  					wacom=CW
  				else
  					xrandr=left
  					wacom=CCW
  				fi
  				;;
  			left)
  				if [ "$1" = "cw" ]; then
  					xrand=normal
  					wacom=NONE
  				else
  					xrandr=inverted
  					wacom=HALF
  				fi
  				;;
  			inverted)
  				if [ "$1" = "cw" ]; then
  					xrandr=left
  					wacom=CCW
  				else
  					xrandr=right
  					wacom=CW
  				fi
  				;;
  			right)
  				if [ "$1" = "cw" ]; then
  					xrandr=inverted
  					wacom=HALF
  				else
  					xrandr=normal
  					wacom=NONE
  				fi
  				;;
  		esac
  		;;
  	*)
  		echo "Usage: $0 {normal|left|right|inverted|cw|ccw}"
  		exit 1
  		;;
  esac
   
  if xrandr --output LVDS1 --rotate "$xrandr"; then
  	xsetwacom --set 13 Rotate "$wacom"
#  	xsetwacom --set cursor Rotate "$wacom"
  	xsetwacom --set 12 Rotate "$wacom"
  	exit 0
  fi
  
  exit 1

After you saved it as "xrandr", open a terminal, go to the folder, in which you saved "xrandr", and type $ chmod +x xrandr

in order to be able to use this script with typing in an terminal $ ./xrandr right for right rotation and $ ./xrandr normal for left.

--User:klob 11.40, 24 October 2010 (CEST)


If you want to easily switch between two orientations, you can use the following script. You can assign this script to the corresponding button on the tablet. It os working on my Thinkpad X61 tablet. If you remove the "yes" after flipflop= the script works as the script above.

#!/bin/sh

#
# wether to run in flipflop-Mode. Leave blank if not.
# In flipflop mode you can easily switch between two preferred orientations.
#
flipflop=yes



par=$1
semaphore=/tmp/rotate.sem
if [ -n "$flipflop" ]; then
  # only if variable $flipflop is set
  if [ -f $semaphore ]; then 
    # semaphore exists
    rm $semaphore
    par=normal
  else
    # semaphore dont exist -> create it
    touch $semaphore
    par=right
  fi
fi



  xrandr=normal
  wacom=NONE
  
  case "$par" in
  	normal)
  		xrandr=normal
  		wacom=NONE
  		;;
  	inverted)
  		xrandr=inverted
  		wacom=HALF
  		;;
  	right)
  		xrandr=right
  		wacom=CW
  		;;
  	left)
  		xrandr=left
  		wacom=CCW
  		;;
  	cw|ccw)
  		case `xrandr --verbose -q -o normal --dryrun | grep "Current rotation" | sed "s/Current\ rotation\ \-\ //g"` in
  			normal)
  				if [ "$par" = "cw" ]; then
  					xrandr=right
  					wacom=CW
  				else
  					xrandr=left
  					wacom=CCW
  				fi
  				;;
  			left)
  				if [ "$par" = "cw" ]; then
  					xrand=normal
  					wacom=NONE
  				else
  					xrandr=inverted
  					wacom=HALF
  				fi
  				;;
  			inverted)
  				if [ "$par" = "cw" ]; then
  					xrandr=left
  					wacom=CCW
  				else
  					xrandr=right
  					wacom=CW
  				fi
  				;;
  			right)
  				if [ "$par" = "cw" ]; then
  					xrandr=inverted
  					wacom=HALF
  				else
  					xrandr=normal
  					wacom=NONE
  				fi
  				;;
  		esac
  		;;
  	*)
  		echo $flipflop
  		if [ -z $flipflop ]; then
  			# only if variable flipflop is not set
	  		echo "Usage: $0 {normal|left|right|inverted|cw|ccw}"
  			exit 1
  		fi
  		;;
  esac
   
  if xrandr --output LVDS1 --rotate "$xrandr"; then
  	xsetwacom --set 13 Rotate "$wacom"
#  	xsetwacom --set cursor Rotate "$wacom"
  	xsetwacom --set 12 Rotate "$wacom"
  	exit 0
  fi
  
  exit 1

--User:dcjfm 10.20, 23 November 2010 (CEST):

Troubleshooting

If the stylus still doesn't work try to reset the bios. This fixed it for me. --Gtx 08:22, 21 April 2008 (CEST)

Ubuntu 11.10 (Oneiric Ocelot): Per the thread at Ubuntuforums, comment out or remove /lib/udev/rules.d/40-inputattach.rules to get the stylus functioning.

Magick-Rotation is useful for auto-rotating the screen but may require switching the cw / ccw notations to match the stylus orientation to that of the screen (bug). --wseltzer