后果很严重!原生的就已经很好很强大了,X41T完全可以正常使用
论坛很多人都说他们驱动不起来自己的wacom手写笔,包括我自己哈~
Google一会就发现了外国的伙计们早解决了这个问题,本文其实就算是照抄了以下文章。
http://ubuntuforums.org/showthread.php?t=967147
https://help.ubuntu.com/community/Wacom
http://linuxwacom.sourceforge.net/index ... /srvlayout
可能有BUG和不足,大家来找找……找到了跟帖哈,我会及时更新的。我的email:mengzhuo1203#gmail.com
本文仅在IBM-X41T下测试成功,但是也很有可能适用其他Wacom的手写笔
1.安装Wacom的XX(我菜,不知道是啥)
代码: 全选
sudo apt-get install xserver-xorg-input-wacom wacom-tools
代码: 全选
xxd /dev/ttyS0
其他的USB驱动的手写笔可能要
代码: 全选
xxd /dev/input/event0
代码: 全选
xxd /dev/input/wacom/
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?
4.设置一个奇怪的文件(人菜……不知道这是什么,我觉得不必要,但是还是贴出来,这个是WIKI中的方案1)
代码: 全选
gksudo gedit /etc/hal/fdi/policy/custom_wacom.fdi
代码: 全选
<?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>
<!-- N-Trig Duosense Electromagnetic Digitizer -->
<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>
可选:hotcat 写了:重新启动X
原理就是先干掉X,再重新运行一次
(其实干掉X之后它自动会重启,类似于Windows下面的Explorer)
先用top命令查看X的Pid,
然后再用kill <Pid>干掉X,
这时就会黑屏,然后X就重启了
万一出问题就Ctrl+Alt+F1切到终端,手动启动X:startx
6.X41T旋转屏幕的脚本 旧
代码: 全选
#!/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
用的时候就加个参数(0,1,2,3)在后面,原文在http://www.thinkwiki.org/wiki/Wacom_Serial_Tablet_PC_Stylus
新
临时解决转了再按键又转不回来的问题,当然这个脚本很笨也是直接修改原来的,希望大侠们能帮帮忙
代码: 全选
#!/bin/sh
#
# This script rotates the display in TabletPCs when screen is changed from
# laptop to tablet mode, or when rotation button is pressed
touch /tmp/screen-rotation
ROTATION=`cat /tmp/screen-rotation`
case "$ROTATION" in
right)
NEW_ROTATION="normal"
xsetwacom set "stylus" Rotate 0
;;
*)
NEW_ROTATION="right"
xsetwacom set "stylus" Rotate 1
;;
esac
/usr/bin/xrandr -o $NEW_ROTATION && echo $NEW_ROTATION > /tmp/screen-rotation
源里有pheyx 写了:windows日记本可以用xournal来代替
——————————————
关于那些该死的tablet按键
9.04以后不知道为什么以前的所有设置都不正确了
在网上搜到一篇要翻墙才看得到的文章(省略废话2W字)
只针对x41t,其他用户不要随便玩……
直接在开机的脚本里启动一些setkeycodes
比如修改/etc/rc.local
添加
代码: 全选
# PageDown, PageUp, Enter, Escape
setkeycodes 6e 109
setkeycodes 6d 104
setkeycodes 69 28
setkeycodes 6b 1
# Tablet Menu Key
setkeycodes 68 130
# Tablet Rotate
setkeycodes 6c 131
# Tablet Ctrl-Alt-Del Key
setkeycodes 67 132
http://wordsarelies.blogspot.com/2009/0 ... d-x41.html
I recently bought a Thinkpad X41 tablet cheap off eBay. And, because it's the kind of thing I do, I promptly set to work installing the latest release of Ubuntu (9.04, Jaunty Jackalope) on it. Since the X41t doesn't have an optical drive, I installed via LiveUSB. The USB can easily be created from an existing Ubuntu install or LiveCD using the included USB Startup Disk Creator (System -> Administration -> USB Startup Disk Creator), or from Windows via instructions like these or these.
I won't trouble you with installation instructions, because the installer is well set up, the Ubuntu Installation Guide is very good, and I didn't have to do anything special to get it working. Installation took about 15 minutes (seriously: very fast), and afterwards it took about 30 seconds to go from GRUB to the login screen.
I'm happy to say that basically everything worked out of the box - including the wireless card and basic tablet functionality. For handwriting recognition, I used Synaptic to install the equivalent of Windows XP's Tablet Input Panel, Cellwriter. And, because it's useful, I installed a Windows Journal equivalent, Xournal.
Two things did not work right away: the tablet hardware buttons (including special PageUp and PageDown keys, a screen rotation button, and a few others), and (since there was no button for it) any kind of screen rotation that didn't involve going through the control panels. The volume keys work, but apparently control the hardware volume level (as distinct from the software volume level set in the Sound control panel), and therefore have no on-screen display.
My key resources for getting these things working were LIKEN Apuntes's Installing Linux, Ubuntu 8.04 Hardy, on a IBM X41 Tablet and Thinkwiki.org, which is a staggeringly good resource for getting Linux to work on Thinkpads.
Tablet Keys
Tablet keys were not actually difficult to make work, but took me a long time because Thinkwiki was down. My understanding of the problem is this: every keypress generates a hexadecimal key scancode in the kernel, which is then passed to X and assigned a separate keycode from 0 to 255. Keycodes from 0-119 are used for standard keyboard keys, and keycodes 120 and above are mostly unused. Once you find the keycodes the kernel uses, it's a trivial matter to find set a keycode in X and assign shortcuts to it. Unfortunately, in 9.04, the kernel's keyboard mask is set to disregard those buttons entirely, making it very difficult to find those keycodes.
Fortunately, though, Thinkwiki has an article on Tablet Hardware Buttons. Armed with these keycodes, I needed only edit my /etc/rc.local (sudo gedit /etc/rc.local) to assign those keys codes in X at startup. The keycodes for the tablet PageUp, PageDown, Enter, and Escape buttons aren't arbitrary: they're the same ones used by the normal PageUp, PageDown, Enter, and Escape keys. For those, add these lines to /etc/rc.local:
# PageDown, PageUp, Enter, Escape
setkeycodes 6e 109
setkeycodes 6d 104
setkeycodes 69 28
setkeycodes 6b 1
...where 6e, 6d, 69, and 6b are the kernel scancodes in the Thinkwiki article I linked, minus the '0x', and 109, 104, 28, and 1 are the keycodes X uses for PageDown, PageUp, Enter, Escape. If you're interested, you can find out what keycode X uses for what key by entering "sudo dumpkeys" (or, since the output is very long, "sudo dumpkeys | less") into the terminal. Sorry if that's a little over-deliberate.
For the other three keys, you can assign keycodes fairly arbitrarily. All the unused keycodes will be at the end of the dumpkeys output; I used 130, 131, and 132 for the Tablet Menu, Rotate, and Ctrl-Alt-Del keys:
# Tablet Menu Key
setkeycodes 68 130
# Tablet Rotate
setkeycodes 6c 131
# Tablet Ctrl-Alt-Del Key
setkeycodes 67 132
These keys are a little trickier, though, because they don't do anything by themselves. I wanted to assign my Tablet Menu key to open up Cellwriter, so I went to System -> Settings -> Keyboard Shortcuts, hit the "Add" button at the bottom, created a "Cellwriter" shortcut which called on the cellwriter command. Then, I clicked the shortcut box and pressed the Tablet Menu key, and the name X uses for that keycode showed up in the box. Unfortunately, when I was done with that, my Tablet Menu key still didn't do anything.
As a workaround, I went to the configuration editor (gconf-editor in terminal) and from there to apps -> metacity -> keybinding_commands. I arbitrarily assigned command_11 to cellwriter, then went to apps -> metacity -> global_keybindings and assigned run_command_11 to the name the Keyboard Shortcuts control panel gave when I pressed the Tablet Menu key. This is incredibly clumsy, but it worked for me.
I left the Ctrl-Alt-Del key alone, because I couldn't think of anything I wanted to do with it. The Tablet Rotate key requires some extra work.
Tablet Rotation
LIKEN Apuntes has a script and very good directions for setting up your tablet screen to rotate. You can even make the screen rotate automatically when it swivels. If you follow those directions, your tablet will screen will rotate automatically, and you can use gconf-editor to assign, say, command_12 to /usr/local/bin/rotatetablet, and run_command_12 to whatever name Keyboard Shortcuts gives you for your Tablet Rotate key.
There is a problem with this. Your screen will rotate, but the tablet input will not, making pen use awkward at best. This is because of a change in the way Ubuntu Jaunty interprets tablet input. Never fear; there is a fix. I've taken it directly from post 104 of this thread on the Ubuntu forums. Without further ado, run:
sudo gedit /etc/init.d/wacomtohal
and paste in these lines:
#! /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
done
Save it, close it, and run these two commands in terminal:
sudo chmod +x /etc/init.d/wacomtohal
sudo update-rc.d wacomtohal defaults 27
After you've done that, restart and everything should work just fine.
Conclusion
Tablet PC support in Linux obviously isn't great, but with a little work the tablet can be made to do everything you'd expect from Windows XP Tablet Edition. Cellwriter and Xournal aren't as good as the Tablet Input Panel and Windows Journal (Cellwriter's handwriting recognition is fairly rudimentary, and Xournal doesn't have it at all), but Ubuntu is snappy on the X41t, and even snappier if you switch (as I did) from the default Gnome desktop environment to Xfce - a simple matter of installing xfce-4 in Synaptic, going to Options -> Select Session and selecting Xfce. It'll even ask you if you want to make it default.
Overall, I'm very happy with the tablet functionality - handwriting recognition isn't something I care much about, since any serious input I do will be through the keyboard anyway. Inking in Xournal is perfectly satisfactory for notetaking, and the ability to annotate PDFs is a nice feature. My only complaint is that Flash videos (from YouTube and Hulu, mostly) are choppy in fullscreen or HD under Ubuntu. This is not the machine's fault, though, or even Ubuntu's - Flash videos run fine in Windows, and higher-definition video formats run fine in Ubuntu using VLC or MPlayer. The fault lies entirely at the door of Adobe's poor Flash implementation in Linux.
That's it - it works.