Logitech G15 Keyboard

From Gentoo-en
Jump to: navigation, search

make.conf

You may want to add these lines to your make.conf file in order to compile corectly tools neeeded for correct compiling of tools such as lcdproc.

File: /etc/make.conf
LCD_DEVICES="g15"
USE="g15 lcd_devices_g15 lcd"

libg15

To get multimedia keys and LCD panel working properly you will need libg15.

emerge libg15

G & M Keys

G-keys and M-keys should work out of the box after installing g15macro package.

emerge g15macro

Then run g15macro (ensure g15daemon is running):

/usr/bin/g15macro

If everything works correctly, Your M1 button backlight should lid (may depend on version of keyboard), else it's most likely caused by missing kernel module UINPUT (g19 or g15 v.2 keyboard).

Linux Kernel Configuration: G-Keys
Device Drivers ---> 
   Input device support --->
      Miscellaneous devices --->
         <*> User level driver support

If none of these worked for you, please reffer to g15forums.

Binding multimedia keys

To check wheter your keys are detected or not, use showkey -s command: After pressing any key it's system keycode should appear. You may want to use those to configure your .Xmodmap file.

showkey

Manually in console

Install xbindkeys and xvkbd.

emerge -av xbindkeys xvkbd

Then the keys being pressed can be identified by running:

xbindkeys -mk

The output of this can be used directly in ~/.xbindkeysrc. For each key, three lines will be given. The first line should be edited to be the command you wish.

If you wish that command to be a series of keys, then xvkbd must be used. For each key make a shell script that calls xvkbd. An example of this would be, for the macro shell.

#!/bin/bash
sleep 0.1
xvkbd -text i
xvkbd -text f
xvkbd -text "

A short sleep does appear to be necessary for the key to work in all programs. The relevant ~/.xbindkeysrc entry would be:

File: ~/.xbindkeysrc:
##macro g2
"/home/kreton/.macros/g2.sh &"
   m:0x10 + c:152
   Mod2 + NoSymbol
"

The bottom two lines were, again, obtained from xbindkeys -mk output and may vary with your keyboard.

As a warning, G1 appears to be reserved and used solely for accessing the options menu of the LCD when using lcdproc and may be also true if only g15composer and/or g15daemon are used.

KDE

In KDE4 go to system manager:

System Settings -> Input Devices -> Keyboard settings -> Keyboard Model:
Logitech | Logitech G15 extra keys via G15daemon

You will need g15daemon installed on your computer. To assign actions to keys use Shortcuts and Gestures in System Settings.

Gnome

In Gnome navigate trough Alacarte menu:

System -> Settings -> Keyboard Preferences -> Keyboard Layouts Preferences -> Keyboard Model:
Logitech | Logitech G15 extra keys via G15daemon

To assign actions use Keyboard Shortcuts manager, you will alsoneed g15daemon installed on your computer.

LCD panel

In order to get the LCD panel working it's needed to compile g15daemon and libg15render:

emerge g15daemon libg15render

Then add g15daemon service to default runlevel:

Note: g15daemon is now started automatically via udev, and longer needs to be added to the default runlevel. Doing so may cause a 'g15daemon failed to start' error during boot.
rc-update add g15daemon default

Supported applications for use with LCD panel

g15composer

g15compser allows for simple usage of the lcd device through a pipe found at /var/run/g15composer. Text sent through a pipe to this file will be displayed on the lcd. Each new pipe sending data to /var/run/g15composer will create a new screen that can be cycled using the MR key.

emerge g15composer

Then add it to default runlevel:

rc-update add g15composer default

Before starting g15composer, it's needed to enter a user who will run the FIFO controls. So we will need to edit /etc/conf.d/g15composer before we can start g15composer.

File: /etc/conf.d/g15composer
FIFO_USER=yourusername
FIFO_GROUP=users

Start it with:

/etc/init.d/g15composer start

lcdproc

Newer versions of lcdproc have basic support for the Logitech G15's LCD Display using g15daemon (use USE flag as stated above in section make.conf)

emerge lcdproc

Eventually you might want to add lcdproc to your default runlevel.

rc-update add lcdproc default && rc-update add LCDd default

To configure lcdproc to use the g15 driver, edit /etc/LCDd.conf

File: /etc/LCDd.conf
diff
-- driver=ncurses
++ driver=g15

You might also want to enable the lcd USE flag so programs such as mythtv are compiled with lcdproc support.

euse --enable lcd

lcd4linux

lcd4linux has a g15 driver however its fairly new.

graphlcd

Graphlcd also has support for the g15 when the g15 USE flag is enabled.

Audio players integration

Amarok integration with g15composer

If there is enabled USE flag on g15composer and Amarok is installed with it, new script called "g15-display.pl" in the script manager in the "General" folder.

XMMS plugin

There is a xmms plugin in the SVN trunk of g15daemon (g15daemon must be installed in order to make this working)

svn co https://g15daemon.svn.sourceforge.net/svnroot/g15daemon/trunk/g15daemon-audio-plugins/g15daemon_xmms g15daemon_xmms
cd g15daemon_xmms
./autogen.sh && ./configure && make && make install

Audacious plugin

There is a Audacious plugin in SVN trunk of g15daemon (g15daemon must be installed in order to make this working)

svn co https://g15daemon.svn.sourceforge.net/svnroot/g15daemon/trunk/g15daemon-audio-plugins/g15daemon_audacious g15daemon_audacious
cd g15daemon_audacious
./autogen.sh && ./configure && make && make install

Troubleshooting & debug

LCD

If you installed g15tools and started g15daemon following instructions above you should get a splash screen and a clock (minimum if it is working).

If you see nothing at all, check for the g15composer pipe:

ls -la /var/run/*g15*

You should see some pid files if the daemon is running and the g15composer pipe should belong to the right user (the other files should belong to root). Note that these files are generated so 'chown' on them is a bad idea as it will only last between restarts of the daemons. If the pipe does not belong to you (or at least you cannot access it as your user), check the files in '/etc/conf.d/g15*' again for proper settings.

You may also want to try debug mode of g15daemon

/etc/init.d/g15daemon stop && /etc/init.d/g15composer stop

If you see something like this:

Code: xorg.conf
...
libg15: Found "LCD" endpoint 2 with address 0x2 maxtransfersize=32}}
libg15: Done opening the keyboard}}
libg15: usb error: ENOSPC.. reducing speed}}
libg15: usb error: ENOSPC.. reducing speed}}
g15daemon 1.2.7 loaded

The daemon might load properly but the LCD will *NOT* work. This is usually the case when there is too little bandwidth (thats what ENOSPC means). The daemon attempts to throttle it down but it will probably fail if you are reading this.

Try an alternative port on your PC. If you are using an USB hub, try plugging the keyboard directly into your PC. If you need the hub because you used all ports, try replugging everything so devices that need high speeds (scanner, printer, lcd keyboard) are directly connected. Stuff like USB sticks, PDA cradles can do their job fine on a hub.

If you can't get it to work or can't hook up everything at once, think about buying a seperate USB controller to get more native USB connections.

Multimedia keys

To find out whether multimedia keys were detected or not, use xinput scommand.

emerge xinput && xinput list

There should be G15 ExtraKeys (multimedia keys) and G15 Gaming Keyboard (keyboard) - (at least for G15v2 keyboard). If you miss any of these, then there is something wrong with detection of device, try recompiling hal (if you use it) or udev, xf86-input-evdev and xorg-server (you should have installed at least xorg-server >= 1.7). Also try checking kernel modules (UINPUT).

g15macro compile option

If you have trouble getting g15macro to work with your hotkey manager, try compile g15macro with the --enable-xtest configuration option. That did the trick for me, enabling my window manager to bind to the events fired.

Obviously some window managers can't bind to synthetic keysyms, and xtest enables it to have non-synthetic keysyms.

Links

[1] - Ubuntu community HOWTO.

[2] - website of g15tools (libg15, g15daemon,g15composer and other)

[3] Gentoo wiki site about setting up multimedia keys

The original of this article is in Gentoo archives here