个人工具

UbuntuHelp:LogitechG15

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 12:46的版本

跳转至: 导航, 搜索


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 UbuntuHelp: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:

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


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). 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!



CategoryHardware CategoryCleanup