# Logitech Cordless Desktop MX

## Koxta

Hi!

I have a little problem with keyboard included in this Logitech set. Some of the special hotkeys are not mapped (they do not have a keycode assigned), so I do this by ie. `setkeycodes e013 148' & etc. by /etc/conf.d/local.start. Anyway, there are still some keys that have the same keycode assigned (ie. `search' and `favourites' buttons have keycode 230 assigned by default). How to change this (I mean, how to scan the key's e0xy code)?

I'm using kernel 2.6.7-r11 and I don't remember this double keycode issue in previous versions.

Regards,

Jurek 'Koxta' Bartuszek

----------

## Apreche

I use a combination of xmodmap and xbindkeys to make all the keys on my logitech cordless freedom keyboard work.

----------

## Koxta

Ok, could you please be more specific? Maybe I could use your config.

Regards,

Jurek 'Koxta' Bartuszek

----------

## Apreche

Hmm.  Well, here's how it works.  First run xev.  xev is a program that captures and displays all X input events sent to it.  So if you focus the xev window and move the mouse in it and type in it you will see output that shows how X interprets this. 

Example:

```
KeyRelease event, serial 28, synthetic NO, window 0x2e00001,

    root 0xb4, subw 0x0, time 106000265, (78,68), root:(279,382),

    state 0x10, keycode 41 (keysym 0x66, f), same_screen YES,

    XLookupString gives 1 bytes:  "f"
```

This is what happens when I release the "f" key.  

You can see that there is a keycode 41 as well as a keysym(bol) of 0x66, f.  

The buttons at the top of your multimedia keyboard do have keycodes.  If you run xev and push them you can see they have keycodes, but not keysymbols.  My favorites button has a keycode of 230.  

xmodmap is a program that allows you to assign keysymbols to keys.  You can use it to do all kinds of stuff.  You can assign the caps lock symbol to the c button and the number 7 to caps lock button, or anything you want.  What you want to do is create and assign key symbols to the keycodes for your extra keys.  Read the xmodmap documenation for specifics.  (man xmodmap).  

xbindkeys is even cooler.  xbindkeys is a program that lets you map keycodes or symbols to execute a single shell command.  For example  I have a binding in my xbindkeys that makes the volume go up when I spin my volume dial. 

```
"amixer -c 0 set 'Wave Surround',0 2%+"

        c:176
```

For more information on that read the xbindkeys documentation.  

Those two programs combined should allow you to make full use of your keyboard in any configuration you want.

----------

## Koxta

 *Apreche wrote:*   

> Hmm.  Well, here's how it works.  First run xev.  xev is a program that captures and displays all X input events sent to it.  So if you focus the xev window and move the mouse in it and type in it you will see output that shows how X interprets this. 
> 
> Example:
> 
> ```
> ...

 

Well, OK, thanks, but you were way too specific =) The problem is that _not_ every hotkey on the top of my keyboard has a keycode, because pressing some of them causes kernel messages in syslog that I should run ie. setkeycodes e013 keycode (this one is for the iTouch button, cause it has no keycode by default).

I know what xev, xmodmap etc. are  :Wink:  However, running xev and pushing those buttons with no keycodes gives no result (nothing happens on xev's stdout). And pressing the search and favourites gives me the same keycode, which is 230. 

I think that you missed the point :-/ But anyway, thanks for reply. Any further ideas are very welcome  :Sad: 

Regards,

Jurek 'Koxta' Bartuszek

P.S. Let me guess - you are using 2.4.x kernel?

----------

## Apreche

Ooooh.  I get it.  You have to configure XKB in your XF86Config or Xorg.conf depending.  Read this for all the info.  

http://www.xfree86.org/current/XKB-Config.html

----------

## oberyno

Hi, check out this thread.  I have the same keyboard  and several buttons don't work. For me, its itouch, messenger/SMS, shopping, and webcam.  I think that's it.  FWIW, I think the only problem with these keys is setting keyboard definitions properly. Here's what I have in my xorg.conf:

```
   Identifier   "Keyboard1"

    Driver   "kbd"

    Option "XkbModel" "logicink"

    Option "XkbLayout" "dvorak"

```

IIRC, different keys work with different layouts.  I did find a config claiming to be for the duo keyboard once, but it was worse than logicink.  Anyway, I haven't looked into it recently.

----------

## Koxta

Hell yeah, I've got exactly what I wanted to have:

in xorg.conf:

```
Section "InputDevice"

    Identifier  "Keyboard1"

    Driver      "kbd"

    Option      "XkbModel"      "logicink"

    Option      "XkbLayout"     "pl"

EndSection
```

in /etc/conf.d/local.start:

```
# iTouch button

setkeycodes e013 147

# Shopping button

setkeycodes e014 148

# Messenger button

setkeycodes e011 145

# Webcam button

setkeycodes e012 146

# Scrolling wheel button

setkeycodes e016 149
```

I didn't map the keys which are enabled after switching the F-Lock off (like save, print, undo, redo, etc.), cause I don't really use them  :Wink: 

xev detects now keycodes as follows:

```
User/Sleep: 223

E-mail: 236

Messenger/SMS: 199

Webcam: 200

iTouch: 147

Search: 229

Shopping: 159

Favorites: 230

My Home: 178

Go: 233

WebBack (over Go): 234

Pushing the scrolling wheel: 151

Next: 153

Previous: 144

Play/Pause: 162

Stop: 164

Media: 237

Mute: 160

VolumeUp: 176

VolumeDown: 174
```

And that's exactly how I edited my /etc/lineakkb.def.

Oh, almost forgot. In KDE - keyboard model is set to ,,Logitech iTouch Internet Navigator Keyboard SE''.

Well, everything works for me now  :Smile:  Thank you very much for helping and I hope this thread will help others.

Regards,

Jurek 'Koxta' Bartuszek

----------

