Difference between revisions of "Wacom Serial Tablet PC Stylus"

From ThinkWiki
Jump to: navigation, search
m (Changed the line about multitouch as it is now supported.)
(xrandr Rotation)
Line 134: Line 134:
  
 
--[[User:Gtx|Gtx]] 13:34, 22 April 2008 (CEST)
 
--[[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
  
 
==Troubleshooting==
 
==Troubleshooting==

Revision as of 12:33, 28 August 2008

Wacom Logo

Wacom Serial Tablet PC Stylus

This is a stylus made for tablet PCs by Wacom.

Features

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

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.

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/

The X config file needs to be changed to use the stylus. 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


Add the following lines to the ServerLayout section:

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

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 "button 1"
   xsetwacom set stylus Button2 "button 3"
   xsetwacom set stylus Button3 "button 3"

xrandr Rotation

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 my 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 "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

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

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)

Models featuring this Device