Skip navigation

Lost password? | Help

Eexpress @ Ubuntu

Posts tagged with "touchpad"

整理以前的配置:鼠标和触摸板

开/关切换触摸板的bash。放到panel上面。开游戏的时候,老是忘记关闭触摸板。
$●  cat switch-开关触摸板.bash
#!/bin/bash 

ts=`synclient -l|grep TouchpadOff` 
ts=${ts#*= } 
if(("$ts" == 0)) 
then 
    synclient TouchpadOff=1 
else 
    synclient TouchpadOff=0 
fi

前提是xorg.conf里面开了
Option "SHMConfig" "on"


Fn+F9 开关触摸屏的热键。ASUS竟然不把这个印到键盘上?

触摸板已经模拟了4个角的点击。3出不来??
RTCornerButton = 2
RBCornerButton = 3
LTCornerButton = 0
LBCornerButton = 0

缺省的触摸板设置有问题,在 /etc/X11/xorg.conf 里面增加了这些:
Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "SendCoreEvents"        "true"
        Option          "Device"                "/dev/psaux"
        Option          "Protocol"              "auto-dev"
# 开水平滚动
        Option          "HorizScrollDelta"      "100"
# 允许外部程序控制触摸板的参数,共享参数的内存地址。
        Option          "SHMConfig"             "on"
# 交换左右键,左手鼠标时候,单击才正常。
        Option          "TapButton1"            "1"
        Option          "TapButton3"            "3"
# 使用双指模拟中键,用于复制文字。
        Option          "TapButton2"            "2"
# 左手鼠标时,系统把xmodmap -pp键值交换,但是同时也影响了触摸板的TapButton1/3事件。
# 左上角模拟1键,右上角模拟2键,右下角模拟3键。
        Option          "LTCornerButton"        "1"     
EndSection


细节设置,可以看帮助:
man synaptics
synclient

或者使用有些容易搞乱的GUI设置软件:
qsynaptics

=====================================
左手鼠标的时候,开FPS游戏还是需要这个的。顺便把鼠标指针的方向也修改下,自己看着清楚些。
$●  cat swap-交换鼠标按键.bash 
#!/bin/bash

but=`xmodmap -pp|head -n 1|cut -d ' ' -f 3`
((but++))
ret=""
ret=`xmodmap -pp|grep "3.*1"`
if [ -z "$ret" ]
then
        prefix="xmodmap -e \"pointer = 3 2 1 4 5 6 7 8 9"
        xsetroot -cursor_name right_ptr
else
        prefix="xmodmap -e \"pointer = 1 2 3 4 5 6 7 8 9"
        xsetroot -cursor_name left_ptr
fi
cmd=${prefix%${but}*}'"'
eval $cmd


光标的主题修改,就只能使用X的设置了。这样才在swap的时候,切换光标方向。
$●  grep '^Xcursor' .Xdefaults 
Xcursor.theme: FlatbedCursors.Green.Huge


新问题出来了,如何立即切换Xcursor哦。
December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31