# Logitech Cordless Desktop S510 / keytouch

## baschni

Hi all!

I just got the Cordless Desktop S510 from Logitech and it works quite well, but there are two problems I have:

1. There are about 5 Multimediakeys (Rotate, Shuffle, Zoom +/-, Zoom 100%), that don't work and aren't recognized by xev. I read this howto (http://gentoo-wiki.com/HOWTO_Use_Multimedia_Keys), that said to listen to the output vor /var/log/messages, which didn't bring anything up as I pressed the key. I also tried the program getscancodes, which is mentioned there, but it didn't react to any key pressed, not to the ones work, too. Is this a kernel issue? Or a X11 issue?

2. I am using keytouch for the rest of the keys. This works quite well, I added keytouch to the default runlevel. But when I restart my computer I always have to execute keytouch as a normal user, which opens a configuration gui, click apply and close it, after that the keys work, but I want them to work without it.

Thx in advance,

surgeon

----------

## revilootneg

 *baschni wrote:*   

> Hi all!
> 
> I just got the Cordless Desktop S510 from Logitech and it works quite well, but there are two problems I have:
> 
> 

 

Hi bashni,

I have a Logitech Cordless Desktop LX710 and the keyboard has quite the same problems as yours.

 *baschni wrote:*   

> 
> 
> ...5 Multimediakeys (Rotate, Shuffle, Zoom +/-, Zoom 100%)...
> 
> 

 

Not exactly these keys for me, but no matter on that

 *baschni wrote:*   

> 
> 
> ... aren't recognized by xev....
> 
> 

 

Same for me

 *baschni wrote:*   

> 
> 
> ...listen to the output vor /var/log/messages, which didn't bring anything up...
> 
> 

 

They are refering to atkbd which handles PS/2 and not HID keyboards. atkbd gives error messages like "unknown scancode.."

 *baschni wrote:*   

> 
> 
> program getscancodes, which is mentioned there, but it didn't react to any key pressed, not to the ones work, too.
> 
> 

 

Do you mean the multimedia keys or the "normal" keyboard keys as well? The normal ones should give output.

 *baschni wrote:*   

> 
> 
> Is this a kernel issue? Or a X11 issue?
> 
> 

 

Well its a bit of both:

Vendors of new keyboards are introducing new keys every day and these have to be handled with (which results in even higher hex ranges and problems with the HID-spec). First the kernel didn't know S510s multimedia keys but it was fixed especially on this keyboard a few month ago. 

If you want to see if the keys really work, enable debugging output for HID (device-drivers-->HID in make menuconfig). But be aware that your passwords can be read out of the logs using this option (it will spam your configs actually).

The keys do need codes to recognize them. Unfortunately xorgs evdev driver (and xorg in all) is only able to handle 255 of them. This wouldn't be a problem if the kernel hex numbers (0x1fff --> going nearly up to 8200 translated into decimal) would be mapped to unused codes below 255 for each keyboard.

You can do this yourself by modifying /usr/include/linux/input.h to your needs but I never read about any good or bad consequences this might have.

 *baschni wrote:*   

> 
> 
> 2. I am using keytouch for ...

 

Sorry can't help on this one. Hope I could help on point 1

revilootneg

----------

## baschni

 *Quote:*   

> Do you mean the multimedia keys or the "normal" keyboard keys as well? The normal ones should give output.

 

Neither the normal nor the multimedia keys give output. So how shell I modify input.h? What is about this kernel fix, would it bring something if I update my kernel?

Greets,

baschni

----------

## revilootneg

 *baschni wrote:*   

> 
> 
> ...would it bring something if I update my kernel?...
> 
> 

 

Depends on if you are running some old kernel like <=2.6.18. I can't say when exactly the fix was added.

 *baschni wrote:*   

> 
> 
> So how shell I modify input.h?
> 
> 

 

That's quite simple: The file contains a lot of lines beginnig #define KEY_.

The first 0-105 are important as they are mapped to the standard PC105-Keyboard keys. There are unused codes from 194 to 200 and from 240 onwards. 

Now check for the values the s510 emitts. The fast way is to use hid debug as explained in my first thread. You will get output wihch key was pressed.

The faster way is to check in /usr/src/<your kernel source>/drivers/hid/hid-input.c for the line saying "/* Reported on certain Logitech wireless keyboards */". All keycodes till "default:    goto ignore;" were added for the newer logitech keyboards. You will find the codes for the five missing keys quickly. Now edit input.h. Find the names for your keys, remove the code and set one of the new codes below 255.

If you are using more than one (multimedia-)keyboard and you overwrite existing values below 255 you might break the keys of the other keyboard as in: That keyboard will generate the same event as the s510.

Greets

revilootneg

PS: Well now that I'm finished I remember reading a probably more understandably guide here  :Wink: 

----------

## baschni

Hi!

I now added HID-Debugging in kernel, but there's still no reaction when I press a non-working key.

I also tried to modify input.h, but I still don't understand it. I found my keys in hid-input.c and then added a few lines in input.h:

```
#define KEY_ZOOMIN      0x101f   /* AC Zoom In */

#define KEY_ZOOMOUT      0x1020   /* AC Zoom Out */

#define KEY_ZOOMRESET      0x1021   /* AC Zoom */

..

```

And put them on lines from 500 - 520, is that ok?

----------

## revilootneg

 *baschni wrote:*   

> And put them on lines from 500 - 520, is that ok?

 

Did you read my posting and the link at gentoo-wiki? You need to set all codes below 255.

And what about your kernel version? Is it new enough?

Compile all HID stuff as modules and load hid with parameter debug=1

revilootneg

----------

## baschni

Yes, I read your posting, and the link you gave doesn't say nothing about input.h or hid.

My problem is, in input.h there are Keys defined from 0 - 250 and then I want my key below 250, but I also have the adresses from hid-input.c.

So how do I define the keys for my keyboard? For example I take #define KEY_BRIGHTNESSDOWN	224 and change it to #define KEY_SHUFFLE	224, so should it work then? For what do I need the hex adresses from hid-input.c then?

----------

## revilootneg

 *baschni wrote:*   

> 
> 
> So how do I define the keys for my keyboard? For example I take #define KEY_BRIGHTNESSDOWN	224 and change it to #define KEY_SHUFFLE	224, so should it work then? For what do I need the hex adresses from hid-input.c then?

 

Yep exactly that's what you have to do. You don't need the hex adresses from hid-input.c

Keep an update of your modified /usr/include/linux/input.h as it belongs to linux-headers.

----------

