# Keycodes changed with 2.6

## Raniz

When I switched to 2.6test9 from 2.4.22 some of my keycodes became different...

Two of my keys now have the same keycode.

Does anyone else have this problem?

I've got a MS Natural Multimedia Keyboard

----------

## jingo

I have the same problem.

I have a Chicony keyboard!!!

Two of my keys have same keycode and a third is having a totally different keycode!!

Very wierd! How do we solve this! Must we have different Xfree setup according to which kernel we are using??? Is this a feature or a bug? ... I would say bug!

----------

## jingo

Are we the only ones who have problems with this????

----------

## LosD

The keycodes has changed, by design AFAIK:

http://lwn.net/Articles/56146/

 *Dave Jones wrote:*   

> - Users of multimedia keys without X will see changes in how the kernel
> 
>   handles those keys. People who customize keymaps or keycodes in 2.4
> 
>   may need to make some changes in 2.6
> ...

 

Hmmm, ok, this shouldn't affect X...

I Dunno, but something has been changed by it, as your problems seem to prove...

Dennis

----------

## franoculator

This problem still exists for me on 2.6.0 and 2.6.1.

xev indicates that some keys have the same keycode as others, other keys have no keycode at all.  I highly doubt this is an X issue,  as I can also obtain the same results by using showkey in console mode.

This is the keyboard I use, the Adesso MCK-91:

http://www.adesso.com/products_detail.asp?productid=54

----------

## strerror

This is a major problem for me as well. I have found it to be an issue with not on Chicony USB kb's but also my logitec internet navigator. The problem is really quite bad for me. because i use an US keymap but because I am living in London, with a uk kb. The doubled up keycodes basically render what is the standard BAR and BACKSLASH key under the us keymap unusable (that is the tilde and hash key under the uk keymap). I am really keen to hear about any solutions for this problem as I am having difficulty assigning new values to these keys.

----------

## nevynxxx

https://forums.gentoo.org/viewtopic.php?t=121508&highlight=

is the thread you are looking for, its a condensed version of a few threads around the place, changing your keymap files is a bit of a hack but it seems to solve everyone's problems, similar key binding problems in x can probably be solved in a similar way

----------

## Raniz

Still, only ten of my 29 special keys have a keycode... Luckily all my multimedia keys work so I can still control xmms from my kb. But almost all my application keys haven't got a keycode  :Sad: 

----------

## jingo

I am still having problems with my multimedia keyboard... chicony!

6 keys are not recognized by the kernel. It says I can use setkeycodes to add the keys.

How?

This is with gentoo-dev-sources-2.6.2-r1

----------

## Raniz

setkeycodes is used to assigns a keycode to a scancode (which one can get with showkey -s), though as I won't even get any scancodes I'm kinda smoked  :Sad: 

----------

## jingo

Where do I get the scancodes... how do I know which scancode to assign?

I tried looking in /usr/include/linux/input.h but everything I tried didn't work as expected!   :Confused: 

----------

## Raniz

 *Raniz wrote:*   

> setkeycodes is used to assigns a keycode to a scancode (which one can get with showkey -s), though as I won't even get any scancodes I'm kinda smoked 

 

 :Smile: 

Note that showkey must run in a console and NOT in xterm or another terminal emulator!

If you use lineak you can take a look in /etc/lineakb.def for the right keycodes.

----------

## Pixelbrei

 *jingo wrote:*   

> Where do I get the scancodes... how do I know which scancode to assign?
> 
> I tried looking in /usr/include/linux/input.h but everything I tried didn't work as expected!  

 

Just press the multimedia-key of which you want to know the scancode, and then look at your dmesg output... i get sth. like this:

```

atkbd.c: Unknown key pressed (translated set 2, code 0x94 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e014 <keycode>' to make it known.

atkbd.c: Unknown key released (translated set 2, code 0x94 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e014 <keycode>' to make it known.

```

----------

## jingo

 *Pixelbrei wrote:*   

>  *jingo wrote:*   Where do I get the scancodes... how do I know which scancode to assign?
> 
> I tried looking in /usr/include/linux/input.h but everything I tried didn't work as expected!   
> 
> Just press the multimedia-key of which you want to know the scancode, and then look at your dmesg output... i get sth. like this:
> ...

 

Ok... I got that on... but how do i know the "<keycode>" then?

----------

## rods

key's are defined in /usr/include/linux/input.h

----------

## jingo

 *rods wrote:*   

> key's are defined in /usr/include/linux/input.h

 

How come they dont work?

----------

