个人工具

“UbuntuHelp:G7Mouse”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/G7Mouse}}
 
{{From|https://help.ubuntu.com/community/G7Mouse}}
 
{{Languages|UbuntuHelp:G7Mouse}}
 
{{Languages|UbuntuHelp:G7Mouse}}
 
 
== Logitech G7 Mouse ==
 
== Logitech G7 Mouse ==
 
The following describes 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 following describes 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.
 
The Logitech receiver needs to be plugged into an USB port directly on the PC.
 
=== Edit xorg.conf file ===
 
=== Edit xorg.conf file ===
 
 
First we'll tell X how to recognize our G7.
 
First we'll tell X how to recognize our G7.
 
<pre><nowiki>
 
<pre><nowiki>
第13行: 第10行:
 
gksudo gedit /etc/X11/xorg.conf
 
gksudo gedit /etc/X11/xorg.conf
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Scroll down until you find the mouse section, something like:
 
Scroll down until you find the mouse section, something like:
 
<pre><nowiki>
 
<pre><nowiki>
第32行: 第28行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Save the file.
 
Save the file.
 
 
=== Restart X ===
 
=== Restart X ===
 
 
First bookmark this page because you will need to come back to finish. Then write down the following steps:
 
First bookmark this page because you will need to come back to finish. Then write down the following steps:
* Log out as usual.
+
# Log out as usual.
* Simultaneously press "Control + Alt + Backspace"
+
2. Simultaneously press "Control + Alt + Backspace"
* If the mouse cursor moves like it should, log back in and proceed to the next section.
+
3. If the mouse cursor moves like it should, log back in and proceed to the next section.
 
+
 
If the mouse cursor won't move, simultaneously press "CONTROL + ALT + F1" and type the following to restore your prior settings:
 
If the mouse cursor won't move, simultaneously press "CONTROL + ALT + F1" and type the following to restore your prior settings:
 
<pre><nowiki>
 
<pre><nowiki>
第45行: 第38行:
 
sudo restartx
 
sudo restartx
 
</nowiki></pre>
 
</nowiki></pre>
 
 
=== Configure key-bindings ===
 
=== Configure key-bindings ===
 
 
First install xvkbd and xvindkeys:
 
First install xvkbd and xvindkeys:
 
<pre><nowiki>
 
<pre><nowiki>
第54行: 第45行:
 
</nowiki></pre>
 
</nowiki></pre>
 
You then have two choices of code to enter. The following code will
 
You then have two choices of code to enter. The following code will
* Allow the mouse "back" button to go back in Nautilus.
+
# Allow the mouse "back" button to go back in Nautilus.
* Allow the left/right tilt on the scroll wheel to scroll text left and right in programs such as Firefox when applicable.
+
2. Allow the left/right tilt on the scroll wheel to scroll text left and right in programs such as Firefox when applicable.
 
Copy and paste the following:
 
Copy and paste the following:
 
<pre><nowiki>
 
<pre><nowiki>
第66行: 第57行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Save the file.
 
Save the file.
 
 
<u>OR</u> you can use my preferred code below which will
 
<u>OR</u> you can use my preferred code below which will
* Allow the mouse "back" button to go back in Nautilus.
+
# Allow the mouse "back" button to go back in Nautilus.
* Allow the left/right tilt on the scroll wheel to move through open tabs in Firefox! :)
+
2. Allow the left/right tilt on the scroll wheel to move through open tabs in Firefox! :)
 
Copy and paste the following:
 
Copy and paste the following:
 
<pre><nowiki>
 
<pre><nowiki>
第80行: 第70行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Save the file.
 
Save the file.
 
 
Finally, go to "System > Preferences > Sessions", click on the "Startup Programs" tab, click "+Add" and enter "xbindkeys" as a Startup Command.
 
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.
 
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)
 
<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 ====
 
==== Delayed Switching ====
 
With the settings above, the tab switching can happen to fast. To circumvent this, create two files  
 
With the settings above, the tab switching can happen to fast. To circumvent this, create two files  
 
 
/usr/bin/xctlpageup.sh
 
/usr/bin/xctlpageup.sh
 
<pre><nowiki>
 
<pre><nowiki>
第103行: 第89行:
 
</nowiki></pre>
 
</nowiki></pre>
 
and
 
and
 
 
 
/usr/bin/xctlpagedown.sh
 
/usr/bin/xctlpagedown.sh
 
<pre><nowiki>
 
<pre><nowiki>
第118行: 第102行:
 
fi
 
fi
 
</nowiki></pre>
 
</nowiki></pre>
 
 
chmod a+x this two, to make them executeable.
 
chmod a+x this two, to make them executeable.
 
 
change your .xbindkeysrc to
 
change your .xbindkeysrc to
 
<pre><nowiki>
 
<pre><nowiki>
第130行: 第112行:
 
m:0x0 + b:6
 
m:0x0 + b:6
 
</nowiki></pre>
 
</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.
 
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:CategoryDocumentation]] [[category:CategoryCleanup]]
 
[[category:CategoryDocumentation]] [[category:CategoryCleanup]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 17:23的版本

Logitech G7 Mouse

The following describes how to configure the 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.

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
gksudo gedit /etc/X11/xorg.conf

Scroll down until you find the mouse section, something like:

Section "InputDevice"
	Identifier	"Configured Mouse"

REPLACE the entire mouse section from "Section "Input Device"" to "End Section" with the following:

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

Save the file.

Restart X

First bookmark this page because you will need to come back to finish. Then write down the following steps:

  1. Log out as usual.

2. Simultaneously press "Control + Alt + Backspace" 3. If the mouse cursor moves like it should, log back in and proceed to the next section. If the mouse cursor won't move, simultaneously press "CONTROL + ALT + F1" and type the following to restore your prior settings:

sudo cp /etc/X11/xorg.conf_backup /etc/X11/xorg.conf
sudo restartx

Configure key-bindings

First install xvkbd and xvindkeys:

sudo apt-get install xvkbd xbindkeys
gedit ~/.xbindkeysrc

You then have two choices of code to enter. The following code will

  1. Allow the mouse "back" button to go back in Nautilus.

2. Allow the left/right tilt on the scroll wheel to scroll text left and right in programs such as Firefox when applicable. Copy and paste the following:

"/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

Save the file. OR you can use my preferred code below which will

  1. Allow the mouse "back" button to go back in Nautilus.

2. Allow the left/right tilt on the scroll wheel to move through open tabs in Firefox! :) Copy and paste the following:

"/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

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. Bonus: 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

#!/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

and /usr/bin/xctlpagedown.sh

#!/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

chmod a+x this two, to make them executeable. change your .xbindkeysrc to

"/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

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.