3.修改/etc/X11/xorg.conf(在WIKI上是方案2,好吧,其实我两个都两个方案都用了)
配置文件后添加下面的东西(这是我的xorg.conf的一部分,X41T用户可以直接拿去不用改了)
代码:
Section "InputDevice"
Driver "wacom"
Identifier "stylus"
# Option "Device" "/dev/input/wacom" # USB ONLY?
Option "Device" "/dev/ttyS0" # SERIAL ONLY
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
# Option "USB" "on" # USB ONLY
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "eraser"
# Option "Device" "/dev/input/wacom" # USB ONLY?
Option "Device" "/dev/ttyS0" # SERIAL ONLY
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
# Option "USB" "on" # USB ONLY
EndSection
Section "InputDevice"
Driver "wacom"
Identifier "cursor"
# Option "Device" "/dev/input/wacom" # USB ONLY?
Option "Device" "/dev/ttyS0" # SERIAL ONLY
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
# Option "USB" "on" # USB ONLY
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "stylus" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents" # For non-LCD tablets only
# InputDevice "pad" # For Intuos3/CintiqV5/Graphire4/Bamboo tablets
# InputDevice "touch" "SendCoreEvents" # Only a few TabletPCs support this type
EndSection
保存,退出。
里面前面有 # 的那行就是被注释掉的(即不起作用), # SERIAL ONLY指串口专用,USB only指USB接口的专用。
如果是USB的Wacom
代码:
Option "Device" "/dev/input/wacom" # USB ONLY?
里面把第2步中有输出数据的设备改进去
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