找回密码
 注册
快捷导航
查看: 9088|回复: 0

【半原创】Linux下驱动起你的Wacom!

  [复制链接] |自动提醒
阅读字号:

12

回帖

0

积分

25

资产值

入门会员 Rank: 1

注册时间
2008-12-19
发表于 2009-1-30 14:03:01| 字数 5,067| - 广西北海市 联通 | 显示全部楼层 |阅读模式
原帖是我自己发的
http://forum.ubuntu.org.cn/viewtopic.php?f=126&t=182227
没有版权问题

这个论坛不支持代码显示,建议大家去原帖的地址(版主:抢论坛生意……)
以下为复制来的:

论坛很多人都说他们驱动不起来自己的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


2.重启后?(当时关键更新完了……需要重启)
代码:
xxd /dev/ttyS0

回车后,用笔在屏幕(或者别的)上画画,看看终端有没有反应(输出一些数据),可能里面的S0是可以改成别的数字只要你有很多手写板……

其他的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?
里面把第2步中有输出数据的设备改进去

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>


5.重启让系统重新载入X配置(知道怎么不重启电脑又可以重启X的人喊一声)
:em05 :em05 大功告成!

可选:
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

评分

参与人数 1资产值 +6 收起 理由
Final_P + 6 优质内容

查看全部评分

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Powered by Discuz! X3.5 © 2001-2023 Comsenz Inc

GMT+8, 2024-4-26 08:43 , Processed in 0.078995 second(s), 27 queries , Gzip On, OPcache On.

手机版|小黑屋|安卓客户端|iOS客户端|Archiver|备用网址1|备用网址2|在线留言|专门网

返回顶部