个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/LogitechG15}}
 
{{From|https://help.ubuntu.com/community/LogitechG15}}
 
{{Languages|UbuntuHelp:LogitechG15}}
 
{{Languages|UbuntuHelp:LogitechG15}}
 
 
 
== Introduction ==
 
== Introduction ==
 
 
This will walk you through the process of installing and configuring your Logitech G15 keyboard in Ubuntu.  After doing this, you will be able to use the LCD display and all of the special keys will work just like normal keys that you can bind shortcuts to.  To do this, you will need to do three things: download and install drivers so that Ubuntu recognizes the LCD and extra keys, add symbols to X so that the extra keys exist in X, and bind the extra keys on the G15 to the symbols you created.
 
This will walk you through the process of installing and configuring your Logitech G15 keyboard in Ubuntu.  After doing this, you will be able to use the LCD display and all of the special keys will work just like normal keys that you can bind shortcuts to.  To do this, you will need to do three things: download and install drivers so that Ubuntu recognizes the LCD and extra keys, add symbols to X so that the extra keys exist in X, and bind the extra keys on the G15 to the symbols you created.
 
 
== Installing G15 drivers with G15tools ==
 
== Installing G15 drivers with G15tools ==
 
 
First, install the required libraries: libusb and libdaemon.
 
First, install the required libraries: libusb and libdaemon.
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install libusb-dev libdaemon-dev
 
sudo apt-get install libusb-dev libdaemon-dev
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Download libg15, G15Daemon, G15Composer, and libG15Render from [http://g15tools.sourceforge.net/].  Extract the packages to their own directory, change to that directory, compile and install the files.  You must install libg15 and libG15Render first.  In each directory, run the following to compile and install the files. To do this, run the following in the directory that you put the files you downloaded:
 
Download libg15, G15Daemon, G15Composer, and libG15Render from [http://g15tools.sourceforge.net/].  Extract the packages to their own directory, change to that directory, compile and install the files.  You must install libg15 and libG15Render first.  In each directory, run the following to compile and install the files. To do this, run the following in the directory that you put the files you downloaded:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
tar -xjvf <file>
 
tar -xjvf <file>
第25行: 第17行:
 
</nowiki></pre>
 
</nowiki></pre>
 
''If you see an error while running <code><nowiki>./configure</nowiki></code>, make a note of what it said was missing before it failed.  This is most likely the name of a program or library that you need to install.  You can open up the Synaptic Package Manager in the System->Administration menu and search for that file.  You will most likely want to install the one that ends in -dev.''
 
''If you see an error while running <code><nowiki>./configure</nowiki></code>, make a note of what it said was missing before it failed.  This is most likely the name of a program or library that you need to install.  You can open up the Synaptic Package Manager in the System->Administration menu and search for that file.  You will most likely want to install the one that ends in -dev.''
 
 
Repeat this for every package that you want to install, making sure to go in the order specified above.  Once you have done this, it is safe to delete the .tar.bz2 files as well as the directories you made; the programs have been installed and you do not need the source anymore.
 
Repeat this for every package that you want to install, making sure to go in the order specified above.  Once you have done this, it is safe to delete the .tar.bz2 files as well as the directories you made; the programs have been installed and you do not need the source anymore.
 
 
After you've done this, run <code><nowiki>sudo g15daemon</nowiki></code>.  If you see a clock appear on the LCD screen, it is working properly.  If not, refer to the Troubleshooting section below.  To set g15daemon to run automatically at startup, edit the sudoers file by running the following:
 
After you've done this, run <code><nowiki>sudo g15daemon</nowiki></code>.  If you see a clock appear on the LCD screen, it is working properly.  If not, refer to the Troubleshooting section below.  To set g15daemon to run automatically at startup, edit the sudoers file by running the following:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo visudo
 
sudo visudo
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Add the following line to the bottom of the file -
 
Add the following line to the bottom of the file -
 
<pre><nowiki>
 
<pre><nowiki>
第38行: 第27行:
 
</nowiki></pre>
 
</nowiki></pre>
 
'''Warning:''' If visudo complains about syntax errors when you exit the program, do '''not''' ignore them!  Go back and look at the file and see what went wrong.  If you mess up the sudoers file you might not be able to run sudo at all, which you'll need a LiveCD to fix.
 
'''Warning:''' If visudo complains about syntax errors when you exit the program, do '''not''' ignore them!  Go back and look at the file and see what went wrong.  If you mess up the sudoers file you might not be able to run sudo at all, which you'll need a LiveCD to fix.
 
 
After you have done this, add g15daemon to your session by going to menus System -> Preferences -> Sessions, selecting New under the Startup Programs tab, and adding one with the name ''G15Daemon'' and the command ''sudo /usr/sbin/g15daemon''.
 
After you have done this, add g15daemon to your session by going to menus System -> Preferences -> Sessions, selecting New under the Startup Programs tab, and adding one with the name ''G15Daemon'' and the command ''sudo /usr/sbin/g15daemon''.
 
 
=== Troubleshooting ===
 
=== Troubleshooting ===
 
 
If you get an error that says:
 
If you get an error that says:
 
<pre><nowiki>
 
<pre><nowiki>
 
g15daemon: error while loading shared libraries: libg15.so.1: cannot open shared object file: No such file or directory
 
g15daemon: error while loading shared libraries: libg15.so.1: cannot open shared object file: No such file or directory
 
</nowiki></pre>
 
</nowiki></pre>
 
 
You need to run <code><nowiki>gksudo gedit /etc/ld.so.conf</nowiki></code> and add <code><nowiki>/usr/local/lib</nowiki></code> at the top of the file.  Then run  
 
You need to run <code><nowiki>gksudo gedit /etc/ld.so.conf</nowiki></code> and add <code><nowiki>/usr/local/lib</nowiki></code> at the top of the file.  Then run  
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo ldconfig
 
sudo ldconfig
 
</nowiki></pre>
 
</nowiki></pre>
 
 
That should fix the problem, try running the daemon again.
 
That should fix the problem, try running the daemon again.
 
 
----
 
----
 
 
If you get an error involving the UINPUT driver or a return code you need to load the uinput module:
 
If you get an error involving the UINPUT driver or a return code you need to load the uinput module:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo modprobe uinput
 
sudo modprobe uinput
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If that works, you'll want to run <code><nowiki>gksudo gedit /etc/modules</nowiki></code> and add <code><nowiki>uinput</nowiki></code> to the list.
 
If that works, you'll want to run <code><nowiki>gksudo gedit /etc/modules</nowiki></code> and add <code><nowiki>uinput</nowiki></code> to the list.
 
 
== Adding key symbols to X ==
 
== Adding key symbols to X ==
 
 
To add the symbols required to represent the special keys, run <code><nowiki>gksudo gedit /usr/share/X11/XKeysymDB</nowiki></code> and add the following lines after the comment at the beginning -  
 
To add the symbols required to represent the special keys, run <code><nowiki>gksudo gedit /usr/share/X11/XKeysymDB</nowiki></code> and add the following lines after the comment at the beginning -  
 
 
<pre><nowiki>
 
<pre><nowiki>
 
G1                      :15000001
 
G1                      :15000001
第98行: 第75行:
 
</nowiki></pre>
 
</nowiki></pre>
 
''Request - Can someone who is more experienced with this file tell me if these hex codes are good?  I don't know if there's a list of reserved codes somewhere.''
 
''Request - Can someone who is more experienced with this file tell me if these hex codes are good?  I don't know if there's a list of reserved codes somewhere.''
 
 
Save this file, and move on to the next section.
 
Save this file, and move on to the next section.
 
 
== Binding the keys to the symbols ==
 
== Binding the keys to the symbols ==
 
 
To use your newly created symbols, you'll need to create an .Xmodmap file in your home directory (or edit the one you already have).  If you do not have one, run ''xmodmap -pke > .Xmodmap'' in your home directory (using a terminal). Open this file (run <code><nowiki>gedit ~/.Xmodmap</nowiki></code>) and add or change the following lines:
 
To use your newly created symbols, you'll need to create an .Xmodmap file in your home directory (or edit the one you already have).  If you do not have one, run ''xmodmap -pke > .Xmodmap'' in your home directory (using a terminal). Open this file (run <code><nowiki>gedit ~/.Xmodmap</nowiki></code>) and add or change the following lines:
 
<pre><nowiki>
 
<pre><nowiki>
第134行: 第108行:
 
keycode 249 = LCD3
 
keycode 249 = LCD3
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Now log out and back in, and your extra keys will work just like any other.  Congrats!
 
Now log out and back in, and your extra keys will work just like any other.  Congrats!
 
 
 
 
----
 
----
 
[[category:CategoryHardware]] [[category:CategoryCleanup]]
 
[[category:CategoryHardware]] [[category:CategoryCleanup]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 20:08的版本

Introduction

This will walk you through the process of installing and configuring your Logitech G15 keyboard in Ubuntu. After doing this, you will be able to use the LCD display and all of the special keys will work just like normal keys that you can bind shortcuts to. To do this, you will need to do three things: download and install drivers so that Ubuntu recognizes the LCD and extra keys, add symbols to X so that the extra keys exist in X, and bind the extra keys on the G15 to the symbols you created.

Installing G15 drivers with G15tools

First, install the required libraries: libusb and libdaemon.

sudo apt-get install libusb-dev libdaemon-dev

Download libg15, G15Daemon, G15Composer, and libG15Render from [1]. Extract the packages to their own directory, change to that directory, compile and install the files. You must install libg15 and libG15Render first. In each directory, run the following to compile and install the files. To do this, run the following in the directory that you put the files you downloaded:

tar -xjvf <file>
cd <directory that it extracted into>
./configure
make
sudo make install

If you see an error while running ./configure, make a note of what it said was missing before it failed. This is most likely the name of a program or library that you need to install. You can open up the Synaptic Package Manager in the System->Administration menu and search for that file. You will most likely want to install the one that ends in -dev. Repeat this for every package that you want to install, making sure to go in the order specified above. Once you have done this, it is safe to delete the .tar.bz2 files as well as the directories you made; the programs have been installed and you do not need the source anymore. After you've done this, run sudo g15daemon. If you see a clock appear on the LCD screen, it is working properly. If not, refer to the Troubleshooting section below. To set g15daemon to run automatically at startup, edit the sudoers file by running the following:

sudo visudo

Add the following line to the bottom of the file -

user ALL= NOPASSWD: /usr/sbin/g15daemon

Warning: If visudo complains about syntax errors when you exit the program, do not ignore them! Go back and look at the file and see what went wrong. If you mess up the sudoers file you might not be able to run sudo at all, which you'll need a LiveCD to fix. After you have done this, add g15daemon to your session by going to menus System -> Preferences -> Sessions, selecting New under the Startup Programs tab, and adding one with the name G15Daemon and the command sudo /usr/sbin/g15daemon.

Troubleshooting

If you get an error that says:

g15daemon: error while loading shared libraries: libg15.so.1: cannot open shared object file: No such file or directory

You need to run gksudo gedit /etc/ld.so.conf and add /usr/local/lib at the top of the file. Then run

sudo ldconfig

That should fix the problem, try running the daemon again.


If you get an error involving the UINPUT driver or a return code you need to load the uinput module:

sudo modprobe uinput

If that works, you'll want to run gksudo gedit /etc/modules and add uinput to the list.

Adding key symbols to X

To add the symbols required to represent the special keys, run gksudo gedit /usr/share/X11/XKeysymDB and add the following lines after the comment at the beginning -

G1                      :15000001
G2                      :15000002
G3                      :15000003
G4                      :15000004
G5                      :15000005
G6                      :15000006
G7                      :15000007
G8                      :15000008
G9                      :15000009
G10                     :15000010
G11                     :15000011
G12                     :15000012
G13                     :15000013
G14                     :15000014
G15                     :15000015
G16                     :15000016
G17                     :15000017
G18                     :15000018
M1                      :15000019
M2                      :1500001A
M3                      :1500001B
LCD0                    :1500001D
LCD1                    :1500001E
LCD2                    :1500001F
LCD3                    :15000020
LCD4                    :15000021

Request - Can someone who is more experienced with this file tell me if these hex codes are good? I don't know if there's a list of reserved codes somewhere. Save this file, and move on to the next section.

Binding the keys to the symbols

To use your newly created symbols, you'll need to create an .Xmodmap file in your home directory (or edit the one you already have). If you do not have one, run xmodmap -pke > .Xmodmap in your home directory (using a terminal). Open this file (run gedit ~/.Xmodmap) and add or change the following lines:

keycode 129 = G5
keycode 130 = G6
keycode 133 = G12
keycode 136 = G10
keycode 137 = G15
keycode 138 = G16
keycode 143 = G12
keycode 146 = G10
keycode 152 = G2
keycode 177 = G1
keycode 182 = G17
keycode 183 = G18
keycode 190 = G3
keycode 208 = G4
keycode 209 = G8
keycode 210 = G9
keycode 220 = G11
keycode 231 = G7
keycode 246 = G13
keycode 251 = G14
keycode  93 = M2
keycode 131 = M3
keycode 184 = M1
keycode 132 = LCD0
keycode 170 = LCD1
keycode 205 = LCD4
keycode 219 = LCD2
keycode 249 = LCD3

Now log out and back in, and your extra keys will work just like any other. Congrats!