LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Logitech Elite Keyboard HOWTO (https://www.linuxquestions.org/questions/linux-hardware-18/logitech-elite-keyboard-howto-125333/)

/bin/bash 12-12-2003 05:12 PM

Logitech Elite Keyboard HOWTO
 
OK this is gonna be a brief tutorial on setting up the Logitech Elite Keyboard for use under KDE and X. XFree86 already has a keyboard layout premade for the Logitech-Elite keyboard. It's actually slightly different (the Elite has 2 additional keys, Go and Back) but other than that the layout is the same.

Look in the file /etc/X11/xkb/symbols/inet

At approximately line #1118 you should have an entry like this:

partial alphanumeric_keys
xkb_symbols "logicdn" {
name[Group1]= "Logitech Cordless Desktop Navigator";
...
...
...
}



If your inet file doesn't have this entry then you probably have an older version. I got mine from XFree86 beta. But not to fear you can copy mine (copy everything between the code tags below into /etc/X11/xkb/symbols/inet) into your inet file and it will work just the same. Just choose an appropriate place to paste it, be careful not to paste between any { of these } only on the outside of them i.e. after } and before the next {.


I wanted to make the Go and Back keys work (the two little keys on the left side of the keyboard next to the scroll wheel) so what I did was I copied thew whole entry for the "Logitech Cordless Desktop Navigator" and modified it and renamed it like this:
Code:

partial alphanumeric_keys
xkb_symbols "logielite" {
    name[Group1]= "Logitech Elite";

    // Media keys
    key <I20>        {        [ XF86AudioMute                ]        };
    key <I6D>        {        [ XF86AudioMedia        ]        };
    key <I2E>        {        [ XF86AudioLowerVolume        ]        };
    key <I30>        {        [ XF86AudioRaiseVolume        ]        };
    key <I22>        {        [ XF86AudioPlay, XF86AudioPause ] };
    key <I24>        {        [ XF86AudioStop                ]        };
    key <I10>        {        [ XF86AudioPrev                ]        };
    key <I19>        {        [ XF86AudioNext                ]        };

    // Left side
    key <I69>        {        [ XF86Go                ]        };
    key <I6A>        {        [ XF86Back                ]        };
    key <I5F>        {        [ XF86User                ]        };

    key <I6C>        {        [ XF86Mail                ]        };
    key <I11>        {        [ XF86Messenger                ]        };
    key <I12>        {        [ XF86WebCam                ]        };

    // Right side
    key <I13>        {        [ XF86iTouch                ]        };
    key <I65>        {        [ XF86Search                ]        };
    key <I14>        {        [ XF86Shop                ]        };
    key <I66>        {        [ XF86Favorites                ]        };
    key <I32>        {        [ XF86HomePage                ]        };

    // Extended function keys
    key <I3B>        {        [ XF86New                ]        }; // F1
    key <I3C>        {        [ XF86Reply                ]        }; // F2
    key <FK13>        {        [ XF86MailForward        ]        }; // F3
    key <FK14>        {        [ XF86Send                ]        }; // F4
    key <FK15>        {        [ Undo                        ]        }; // F5
    key <FK16>        {        [ Redo                        ]        }; // F6
    key <FK17>        {        [ Print                        ]        }; // F7
    key <I42>        {        [ XF86Save                ]        }; // F8
    key <I43>        {        [ XF86MyComputer        ]        }; // F9
    key <I44>        {        [ XF86Documents                ]        }; // F10
    key <I57>        {        [ XF86Pictures                ]        }; // F11
    key <I58>        {        [ XF86Music                ]        }; // F12

};

NOTE: The two bold entries are what I added to enable the two side buttons Go and Back, also I renamed XF86Stanby to XF86User which matches the keyboard.

Now if you go to K Menu -> Configuration -> KDE -> Accessibility -> Keyboard Layout. Now check Enable Layouts and this should allow you to select a Keyboard from the Keyboard model pull-down menu. There are quite a few if you have the latest XFree86 installed. But unfortuneately Logitech Elite is not one of them... yet! Here's what you do to add it to the list.

Edit /etc/X11/xkb/rules/xfree86.lst

Scroll down to the Logitech entries and add a new entry like this.

Code:

  logicdn        Logitech Cordless Desktop Navigator
  logidak        Logitech Deluxe Access Keyboard
  logielite        Logitech Elite
  logiik        Logitech Internet Keyboard
  itouch        Logitech iTouch

Once again what is in bold is what I added to the file. NOTE: I put mine in alphabetical order like the rest, I don't think it matters.

So now you can go back to K Menu -> Configuration -> KDE -> Accessibility -> Keyboard Layout and when you use the Keyboard model pull-down menu the Logitech Elite should be listed along with the others.



So now your keyboard is ready to start assigning keys in KDE. But what if you don't use KDE and you want to be able to define the keyboard for say Blackbox or XFce? In that case you need to assign the keyboard from the /etc/X11/XF86Config-4 file. Everything is already setup to do that you only need to edit one more file.

Edit the file /etc/X11/xkb/rules/xfree86. Scroll down to the inet keyboards section
! $inetkbds =

Then I put the lable logielite in the same order I had placed it in the inet file (right after the freedom navigator), like this:
Code:

! $inetkbds = airkey acpi scorpius \
              brother \
              btc5113rf btc5126t btc9000 btc9000a \
              cherryblue cherrybluea \
              chicony chicony9885 \
              compaqeak8 compaqik7 compaqik13 compaqik18 armada presario ipaq \
              dell inspiron \
              dexxa diamond genius \
              ennyah_dkb1008 \
              hpi6 hp2501 hp2505 hp5181 hpxe3gc hpxe3gf hpxe4xxx hpzt11xx \
              hp500fa hp5xx \
              honeywell_euroboard \
              rapidaccess rapidaccess2 rapidaccess2a \
              ltcd logicdit logicdp logicdpa logicdpa2 logicdo logicfn logielite \
              logicdn logidak logiik itouch logiitc logiik logiink itouchin \
              mx1998 mx2500 mx2750 \
              microsoftinet microsoftpro microsoftprose microsoftoffice \
              oretec \
              propeller \
              qtronix \
              samsung4500 samsung4510 \
              sk1300 sk2500 sk6200 sk7100 \
              sven symplon toshiba_s3000 trust trustda yahoo

Thats it. Now just edit XF86Config-4 and change your keyboard section like this:

Code:

Section "InputDevice"
    Identifier "Keyboard1"
    Driver "Keyboard"
    Option "XkbRules" "xfree86"
    Option "XkbModel" "logielite"
    Option "XkbLayout" "us"
EndSection

Of course you can verify the keys are working properly by running xev and pressing some keys. I verified the keys I added are working:
Code:

KeyPress event, serial 27, synthetic NO, window 0x2600001,
    root 0x41, subw 0x0, time 179142, (181,2), root:(870,22),
    state 0x10, keycode 234 (keysym 0x1008ff26, XF86Back), same_screen YES,
    XLookupString gives 0 characters:  ""

KeyRelease event, serial 27, synthetic NO, window 0x2600001,
    root 0x41, subw 0x0, time 179362, (181,2), root:(870,22),
    state 0x10, keycode 234 (keysym 0x1008ff26, XF86Back), same_screen YES,
    XLookupString gives 0 characters:  ""

KeyPress event, serial 27, synthetic NO, window 0x2600001,
    root 0x41, subw 0x0, time 180752, (181,2), root:(870,22),
    state 0x10, keycode 233 (keysym 0x1008ff5f, XF86Go), same_screen YES,
    XLookupString gives 0 characters:  ""

KeyRelease event, serial 27, synthetic NO, window 0x2600001,
    root 0x41, subw 0x0, time 180945, (181,2), root:(870,22),
    state 0x10, keycode 233 (keysym 0x1008ff5f, XF86Go), same_screen YES,
    XLookupString gives 0 characters:  ""

As you can see the XF86Go and XF86Back indicate that the keys are working.

Since each Windowmanager/Desktop environment has it's own unique way of assigning actions to these keys I'll not attempt to explain that here. I believe there is another thread similar to this one which deals with HOWTO assign events to Logitech keyboard.

So I think that is about it. I sure hope you found this useful.

<edit>Just a note about Xorg. Everything should be just about the same, if not a little easier. Xorg release 6.8.1 has a keyboard defined which is identical in layout to the Logitech Elite, its called Logitech iTouch Internet Navigator Keyboard SE The only difference I see is there are a couple keys with different names. If you are using KDE just select the keyboard from the Control Panel and everything should work.

It works fine using the 2.4.X kernel and of course some keys don't work with the 2.6.X kernel.


The xkb_symbols "logiinkse" is what you would use in your xorg.conf file. Remember when you switch to xorg the keyboard driver is xkb not keyboard, so you should have that in the xorg.conf file, something like this:
Code:

Section "InputDevice"
    Identifier  "Keyboard1"
    Driver      "kbd"
    Option  "AutoRepeat" "500 30"
    Option  "XkbRules"  "xorg"
    Option  "XkbModel"  "logiinkse"
    Option  "XkbLayout"  "us"
    Option  "XkbVariant" "us"
EndSection

For those of you with USB problems Xorg also has this keyboard, Logitech iTouch Internet Navigator Keyboard SE (USB) that may solve some of your problems.

fr33d0m 12-14-2003 12:36 AM

Re: Logitech Elite Keyboard HOWTO
 
hi "/bin/bash",

I read & follow ur email Logitech Elite Keyboard HOWTO, can u help me about:

How can i assign an event with my new configuration?

thnx in advance

fr33d0m

fr33d0m 12-14-2003 12:53 AM

i forget to say, my Desktop in WindowMaker...

thnx again...

f

/bin/bash 12-14-2003 12:14 PM

OK I edited the thread and added a link to a thread which deals with assigning events to the keyboard. I don't know if windowmaker is covered but if not you'll have to post a thread because I can't help you with that.

fr33d0m 12-14-2003 02:01 PM

Re: Logitech Elite Keyboard HOWTO -> WindowMaker handlers
 
Hi list,

The very useful How-to "Logitech Elite Keyboard HOWTO" have a liltle differences in practice with my Logitech Navigator Keyboard, this are the diff:

In /etc/X11/xkb/symbols/inet the code is:
Quote:

partial alphanumeric_keys
xkb_symbols "logielite" {
name[Group1]= "Logitech Elite";

// Media keys
key <I20> { [ XF86AudioMute ] };
key <I6D> { [ XF86AudioMedia ] };
key <I2E> { [ XF86AudioLowerVolume ] };
key <I30> { [ XF86AudioRaiseVolume ] };
key <I22> { [ XF86AudioPlay, XF86AudioPause ] };
key <I24> { [ XF86AudioStop ] };
key <I10> { [ XF86AudioPrev ] };
key <I19> { [ XF86AudioNext ] };

// Left side
key <I69> { [ XF86Go ] };
key <I6A> { [ XF86Back ] };
key <I5F> { [ XF86Standby ] }; // <--- here is the diff
key <I6C> { [ XF86Mail ] };
key <I11> { [ XF86Messenger ] };
key <I12> { [ XF86WebCam ] };

// Right side
key <I13> { [ XF86iTouch ] };
key <I65> { [ XF86Search ] };
key <I14> { [ XF86Shop ] };
key <I66> { [ XF86Favorites ] };
key <I32> { [ XF86HomePage ] };

// Extended function keys
key <I3B> { [ XF86New ] }; // F1
key <I3C> { [ XF86Reply ] }; // F2
key <FK13> { [ XF86MailForward ] }; // F3
key <FK14> { [ XF86Send ] }; // F4
key <FK15> { [ Undo ] }; // F5
key <FK16> { [ Redo ] }; // F6
key <FK17> { [ Print ] }; // F7
key <I42> { [ XF86Save ] }; // F8
key <I43> { [ XF86MyComputer ] }; // F9
key <I44> { [ XF86Documents ] }; // F10
key <I57> { [ XF86Pictures ] }; // F11
key <I58> { [ XF86Music ] }; // F12

};


other stuff is OK!
Modification for XFree86V4 in /etc/X11/xkb/rules/xfree86 can be:

Quote:

logiinetnav us = us(pc104)+inet(logiinetnav)
logiinetnav en_US = en_US(pc104)+inet(logiinetnav)
logiinetnav * = en_US(pc104)+inet(logiinetnav)+%l%(v)
--->
logielite us = us(pc104)+inet(logielite)
logielite en_US = en_US(pc104)+inet(logielite)
logielite * = en_US(pc104)+inet(logielite)+%l%(v)
<---
logicordless us = us(pc104)+inet(logicordless)
logicordless en_US = en_US(pc104)+inet(logicordless)
logicordless * = en_US(pc104)+inet(logicordless)+%l%(v)

and a modification to ~/GNUstep/Defaults/WMRootMenu file for WMaker window manager:

Quote:

(
iTouch,
(
init,
("Eterm init" , SHORTCUT, "XF86Go", EXEC, "Eterm -O --shade 70"),
(Emacs21, SHORTCUT, "XF86Back", EXEC, emacs),
(xLock, SHORTCUT, "XF86Standby", EXEC, "xlock -remote -nice 19 -mode matrix")
),
(
"Multimedia Control",
(Mplayer,
SHORTCUT,
"XF86AudioMedia",
EXEC, "gmplayer -zoom -framedrop"
),
(Rewind, SHORTCUT, "XF86AudioPrev", EXEC, "xmms --rew"),
(Forward, SHORTCUT, "XF86AudioNext", EXEC, "xmms --fwd"),
("Volume Down", SHORTCUT, "XF86AudioLowerVolume", EXEC, "aumix -v-4"),
("VOlume Up", SHORTCUT, "XF86AudioRaiseVolume", EXEC, "aumix -v+4"),
(Mute, SHORTCUT, "XF86AudioMute", EXEC, "/home/freedom/bin/logitechctl mute"),
("Play/Pause", SHORTCUT, "XF86AudioPlay", EXEC, "xmms -t"),
(Stop, SHORTCUT, "XF86AudioStop", EXEC, "xmms --stop")
),
(
"e-Comm",
("Mail Client", SHORTCUT, "XF86Mail", EXEC, evolution),
("Real Messenger", SHORTCUT, "XF86Messenger", EXEC, gaim)
),
(
"e-Utils",
("Galeon Short", SHORTCUT, "XF86HomePage", EXEC, galeon),
("Find!", SHORTCUT, "XF86Search", EXEC, "galeon http://www.google.com"),
(Gimp, SHORTCUT, "XF86iTouch", EXEC, gimp),
(Overnet , SHORTCUT, "XF86Shop", EXEC, ed2k_gui),
(gCombust , SHORTCUT, "XF86Favorites", EXEC, gcombust)
)
)


And all is OK :D Thnx and salu2 desde Mexico :)

References:
http://www.linuxquestions.org/questi...hreadid=125333
http://groups.google.com/groups?q=WM....home.l&rnum=1
http://www.linuxquestions.org/questi...threadid=53834

Phage 02-23-2004 01:27 AM

Thanks for this wonderful tutorial. It works just fine for my keyboard except the four keys: messenger/sms, webcam, iTouch, and Shopping. I have a regular logitech elite keyboard (not wireless.) xev doesn't recognize these keys but a tail of /var/log/messages states (for the "Shopping" key):
Code:

Feb 23 01:26:16 Phage64 atkbd.c: Unknown key pressed (translated set 2, code 0x94 on isa0060/serio0).
Feb 23 01:26:16 Phage64 atkbd.c: Use 'setkeycodes e014 <keycode>' to make it known.
Feb 23 01:26:16 Phage64 atkbd.c: Unknown key released (translated set 2, code 0x94 on isa0060/serio0).
Feb 23 01:26:16 Phage64 atkbd.c: Use 'setkeycodes e014 <keycode>' to make it known.

What should I do? they keycodes i enter it says are out of bounds? Looking at the inet file in your example that code does match up. It bothers me that the four keys that don't work have consecutive numbering (0x11, 0x12, 0x13, 0x14) curious

I am using gentoo with gnome window manager (regular metacity)

/bin/bash 02-27-2004 06:33 PM

I noticed that too on my keyboard. I knew the keys worked at one time because I had Messenger/SMS mapped to ymessenger and Webcam was mapped to Camorama. So of course at first I thought that I had broken my keyboard and I just ignored the keys. Then when I saw your post I knew we both didn't break the same keys. Some more searching and I discovered the keys worked when I booted my 2.4 kernel. So thats where it stand right now. Something in the new 2.6.x kernel keyboard driver seems to not like those keys. If I find out anything more I'll let you know.

I don't really know if this is a bug or if I'm doing something wrong? I might go ahead and submit a bug report just in case.

Phage 02-29-2004 01:28 PM

I use kernel 2.6 also (2.6.3-gentoo-r1) and it doesn't work. I guess I'll build a 2.4 kernel sometime and see if it works.

shryke 02-29-2004 05:28 PM

getting this to work on 2.6 kernels
 
First off, thanks so much for this information. Didn't think I'd be able to make my logitech elite keyboard use the extra buttons with nix. I had the same probs yall talked about with the 2.6.x kernels, currently I'm on 2.6.3, on gentoo. Anyway, this is how I got it working. First, as root I set the keycodes. You probably want to add this in to a startup script or something so it will do it with every boot.

#For the messenger key
setkeycodes e011 112
# For the webcam key
setkeycodes e012 116
# For the shopping key
setkeycodes e014 118
# For the itouch key
setkeycodes e013 120

Then I edited the xmodmap to use the new keycodes. Mine looks like this:

keycode 144 = logitech_rew
keycode 239 = logitech_sms
keycode 222 = logitech_webcam
keycode 139 = logitech_itouch
keycode 123 = logitech_shopping
keycode 153 = logitech_fwd
keycode 160 = logitech_mute
keycode 162 = logitech_playpause
keycode 164 = logitech_stop
keycode 174 = logitech_voldown
keycode 176 = logitech_volup
keycode 178 = logitech_myhome
keycode 223 = logitech_user
keycode 229 = logitech_search
keycode 230 = logitech_favorites
keycode 233 = logitech_go
keycode 234 = logitech_arrow
keycode 236 = logitech_email
keycode 237 = logitech_media


Now they should all be working. I changed the xmodmap simply because I couldn't find the right setkeycodes number to make them match what you already used. Like setkeycode e011 112 assigns it to key 239, *shrugs*, but this way works and I don't think it bothers any other keys that were defined already.

/bin/bash 03-01-2004 04:05 AM

shryke
I was working with setkeycodes myself. I noticed I couldn't use a keycode above 127?

e.g.
setkeycode e011 127 #This works
setkeycode e011 128 #This tells me the keycode is out of range?


Also the keycodes don't seem to have any logical order, and they are not decimal like they are supposed to be but they are not hex either?

I then built my keyboard driver as a module (atkbd) so I could pass it parameters but had no luck there either. It supposedly has three different key sets you can choose with the set= parameter but I never got it to use anything other than the default set=2. I even modified atkbd.c and set it manually but it still used set 2? But I'm not a C programer so that doesn't prove anything.

Anyways, I still fiddle with it when I get some spare time. If any one figures out the mystery of the setkeycode numbering scheme please "clue me."

shryke 03-01-2004 02:01 PM

/bin/bash
I did read someplace that the keycodes wont go over 127, which is why I used the codes that I did. Also I couldn't figure out the numbering scheme either. I just credited it to the differences in how X and the kernel handle the keycodes. Doesn't X have its own unique keycodes separate from the kernel? Could be wrong *shrugs*

/bin/bash 03-01-2004 09:51 PM

Quote:

I did read someplace that the keycodes wont go over 127, which is why I used the codes that I did. Also I couldn't figure out the numbering scheme either. I just credited it to the differences in how X and the kernel handle the keycodes. Doesn't X have its own unique keycodes separate from the kernel? Could be wrong *shrugs*
Yes X does have its own way of doing things. Most likely (depending on how your XF86Config file looks) you are probably using the keycodes file in /etc/X11/xkb/keycodes/xfree86. This file basically gives each keycode a unique identifier .
e.g.
<END> = 103;

Also note in the file these lines:
Code:

xkb_keycodes "basic" {

    minimum= 8;
    maximum= 255;

And the keycodes do go up to 255, so I do think there is something wrong with the setkeycodes program.

What you actually did by using the setkeycodes program is you changed the identifier for the keys. If you look in the file /etc/X11/xkb/keycodes/xfree86 you'll see that the keycodes you set the keys to are actually already identified like this:

Code:

OLDID        OLDKEY        NEWID        NEWKEY
<I11>        145        <I6F>        239
<I12>        146        <I5E>        222
<I13>        147        <I0B>        139
<I14>        148        <KPDC>        123

So actually you could skip the xmodmap file and just edit the /etc/X11/xkb/symbols/inet file if you setup your rc.local file to run the setkeycodes commands every time you boot.

You would just change the four keys in the inet:
Code:

    key <I6F>        {        [ XF86Messenger                ]        };
    key <I5E>        {        [ XF86WebCam                ]        };

    // Right side
    key <I0B>        {        [ XF86iTouch                ]        };
    key <I65>        {        [ XF86Search                ]        };
    key <KPDC>        {        [ XF86Shop                ]        };

I never checked to see if these keys are being used for something else, so don't blame me if there are problems. Also like I said this only applies to you if you use the keycodes file /etc/X11/xkb/keycodes/xfree86.

CCMCGeek 03-15-2004 04:30 PM

A question to /bin/bash or anyone:

Kernel 2.6.4 (customized, not stock), SuSE 9.0, Logitech Elite Keyboard, PS/2 (So it's not a USB issue)

How did you come up with the scancodes for setkeycodes? (The e011, etc.) I tried using showkey -s before running the setkeycodes lines you mentioned, and nothing appeared when I hit any of the keys that stopped working (shop, itouch, sms, webcam). After I ran the setkeycodes lines, showkey -s would list keycodes for those buttons, but they aren't like the keycodes that are generated for other buttons (ex: E-Mail, Media, etc). Also, when I run xev to try and see what's going on, the keys that are "patched" back in - SMS, Webcam, etc - generate ButtonPush and ButtonRelease events... ?

The reason I ask how you found the scancodes is that I have another complete set of function keys located on my F-keys row, which used to work under 2.4, but doesn't work under 2.6 anymore.

Finally, did you submit that bug report? I think it might need to be sent in, I don't know why these keys stopped working, but i'm concerned whether there will be enough keycodes in 1-127 to program unique functions for all these buttons.

Phage 03-15-2004 05:06 PM

I just looked at the system logger while pressing the keys to see the first code (e011) you can do this by hitting ctrl+alt+F12 or typing 'tail /var/log/messages' (depending on your system logger.) You should see something like this:
Code:

Mar 15 17:02:27 Phage64 atkbd.c: Unknown key pressed (translated set 2, code 0xd8 on isa0060/serio0).
Mar 15 17:02:27 Phage64 atkbd.c: Use 'setkeycodes e058 <keycode>' to make it known.
Mar 15 17:02:27 Phage64 atkbd.c: Unknown key released (translated set 2, code 0xd8 on isa0060/serio0).
Mar 15 17:02:27 Phage64 atkbd.c: Use 'setkeycodes e058 <keycode>' to make it known.

Which also explains why xev wont show them

brenton 04-01-2004 07:41 PM

So is it possible to get all the keys working under 2.6? (F keys too?) I just bought a Logitech MX Duo a few days ago, and i've tried a few things but maybe i don't quite understand what to do. Can it be done at all, or will it take a fix in the kernel?

There's a mention of a logitech-keyboard-fix in the 2.6.5-rc3-mm4 patch, but it says it's a fix for something that broke in 2.6.5-rc2 I think. Does anyone know anything more about it?


All times are GMT -5. The time now is 11:55 PM.