个人工具
登录
查看“UbuntuHelp:G7Mouse”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:G7Mouse”的源代码
来自Ubuntu中文
←
UbuntuHelp:G7Mouse
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/G7Mouse}} {{Languages|UbuntuHelp:G7Mouse}} <<Include(Tag/Unsupported)>> {|border="1" cellspacing="0" | '''This content is quite old and may not be applicable to current versions of Ubuntu.''' (please remove this note if the page is updated) |} == Logitech G7 Mouse == The following desgraphicalcribes how to configure the [http://www.logitech.com/index.cfm/products/details/US/EN,CRID=2135,CONTENTID=10716 Logitech G7 Laser Cordless Mouse]. Code was originally designed for Ubuntu 5.10 "The Breezy Badger". The Logitech receiver needs to be plugged into an USB port directly on the PC. === Edit xorg.conf file === First we'll tell X how to recognize our G7. <pre><nowiki> sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup gksudo gedit /etc/X11/xorg.conf </nowiki></pre> Scroll down until you find the mouse section, something like: <pre><nowiki> Section "InputDevice" Identifier "Configured Mouse" </nowiki></pre> REPLACE the entire mouse section from "Section "Input Device"" to "End Section" with the following: <pre><nowiki> Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "Protocol" "evdev" Option "Dev Name" "Logitech USB Receiver" Option "Device" "/dev/input/mice" Option "Buttons" "8" Option "ZAxisMapping" "4 5 7 8" EndSection </nowiki></pre> Save the file. === Restart X === First bookmark this page because you will need to come back to finish. Then write down the following steps: <ol><li>Log out as usual. </li><li>Simultaneously press "Control + Alt + Backspace" </li><li>If the mouse cursor moves like it should, log back in and proceed to the next section.</li></ol> If the mouse cursor won't move, simultaneously press "CONTROL + ALT + F1" and type the following to restore your prior settings: <pre><nowiki> sudo cp /etc/X11/xorg.conf_backup /etc/X11/xorg.conf sudo restartx </nowiki></pre> === Configure key-bindings === First install xvkbd and xvindkeys: <pre><nowiki> sudo apt-get install xvkbd xbindkeys gedit ~/.xbindkeysrc </nowiki></pre> You then have two choices of code to enter. The following code will <ol><li>Allow the mouse "back" button to go back in Nautilus. </li><li>Allow the left/right tilt on the scroll wheel to scroll text left and right in programs such as Firefox when applicable.</li></ol> Copy and paste the following: <pre><nowiki> "/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]"" m:0x0 + b:6 "/usr/X11R6/bin/xvkbd -xsendevent -text "\[right]"" m:0x0 + b:7 "/usr/X11R6/bin/xvkbd -xsendevent -text "\[left]"" m:0x0 + b:8 </nowiki></pre> Save the file. <u>OR</u> you can use my preferred code below which will <ol><li>Allow the mouse "back" button to go back in Nautilus. </li><li>Allow the left/right tilt on the scroll wheel to move through open tabs in Firefox! :)</li></ol> Copy and paste the following: <pre><nowiki> "/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]"" m:0x0 + b:6 "/usr/X11R6/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Down]"" m:0x0 + b:7 "/usr/X11R6/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Up]"" m:0x0 + b:8 </nowiki></pre> Save the file. Finally, go to "System > Preferences > Sessions", click on the "Startup Programs" tab, click "+Add" and enter "xbindkeys" as a Startup Command. Log out, then log in again and run a final test. <u>Bonus</u>: You do ''not'' need the "Logitech Applet" as you can change the sensitivity settings directly on the G7 mouse by pressing the "+" and "-" buttons on the mouse next to the scroll wheel. B) ==== Delayed Switching ==== With the settings above, the tab switching can happen to fast. To circumvent this, create two files /usr/bin/xctlpageup.sh <pre><nowiki> #!/bin/bash if [ ! -f /tmp/pageup.lok ]; then touch /tmp/pageup.lok /usr/X11R6/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Up]" sleep 0.1 rm -f /tmp/pageup.lok else sleep 1 rm -f /tmp/pageup.lok fi </nowiki></pre> and /usr/bin/xctlpagedown.sh <pre><nowiki> #!/bin/bash if [ ! -f /tmp/paged.lok ]; then touch /tmp/paged.lok /usr/X11R6/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Down]" sleep 0.1 rm -f /tmp/paged.lok else sleep 1 rm -f /tmp/paged.lok fi </nowiki></pre> chmod a+x this two, to make them executeable. change your .xbindkeysrc to <pre><nowiki> "/usr/X11R6/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]" " m:0x0 + b:8 "/bin/bash /usr/bin/xctlpageup.sh" m:0x0 + b:7 "/bin/bash /usr/bin/xctlpagedown.sh" m:0x0 + b:6 </nowiki></pre> The tilt wheel then calls the scripts that will lock restrict itself to one call per 0.1 second. The second cause in the shell scripts is for removing lost lok files. ---- [[category:CategoryHardware]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:G7Mouse
。