# Kernel 2.6 and Extended Keyboards

## davecs

On my old box, a PC-Chips M810LMR, I had used both Mandrake and Gentoo, and using xev and some editing of files I could get every key on my Microsoft Natural Multimedia keyboard going. I tried installing Gentoo with a 2.6 kernel in a separate partition, and some, though not all, of the extended keys did not respond, so I tried xev and found that their keypresses were not detected.

I have just set up a new computer, and for speed have loaded up Mandrake 10 Community (though as soon as I get time, I will be installing Gentoo) and this uses a 2.6.3 kernel. The same keys that did not respond under 2.6 before do not work again.

I would like to have this sorted before I load Gentoo. Does anyone know if there is something I can do to fully run my extended keyboard with kernel 2.6?

----------

## cgreene

bump

I would also be interested in this...

----------

## mr-

this can be totally wrong quess but only thing comes in my mind is you may have a wrong "XkbModel" option in XF86Config-4/Xorg.conf file. In your case there should probably read Option "XkbModel" "microsoft" then you should be able to verify keys with the xev.

# mr-

----------

## Andersson

Those multimedia keys are a mess  :Very Happy:  Perhaps one of these threads can help you:

https://forums.gentoo.org/viewtopic.php?t=110728 (The first posts are about another problem, skip down a bit)

https://forums.gentoo.org/viewtopic.php?t=152115

----------

## davecs

Hi, thanks for the links!

I have now solved the problem (to an extent). One of the problems is that the decimal number you declare in the "setkeycodes" command seems to bear no relation to the number returned by "xev" under X. Still, I've found a solution which works for me. As many of the others who had this problem also have a Microsoft keyboard similar to mine, I shall set  out my solution in full.

First, in a  terminal as root, type "nano /usr/bin/setupkeys" and type in the following:

```

#!/bin/sh

setkeycodes e064 89

setkeycodes e03c 90

setkeycodes e005 91

setkeycodes e016 92

setkeycodes e03b 59

setkeycodes e008 116

setkeycodes e007 85

setkeycodes e03e 126

setkeycodes e03f 93

setkeycodes e040 94

setkeycodes e041 118

setkeycodes e042 120

setkeycodes e043 121

setkeycodes e023 122

setkeycodes e057 123

setkeycodes e058 124

```

Press CTRL-O to save and CTRL-X to exit. Locate it in File Manager Super User Mode, and right click on the file, select "Properties" and make the file executable. Run it. This will have your keys returning "something". Still as root, do "nano /etc/conf.d/local.start" and add the line "setupkeys", save and exit as before. This will run the script every time you reboot.

If you are using kde (if not you're on your own) continue as follows:

Run kwrite, and enter the following lines:

```

#!/bin/sh

 

xmodmap -e 'keycode 123=F18' #My Pictures

xmodmap -e 'keycode 128=F19' #My Music

xmodmap -e 'keycode 127=F20' #Messenger

xmodmap -e 'keycode 129=F21' #Log Off

xmodmap -e 'keycode 239=F22' #My Documents

xmodmap -e 'keycode 222=F23' #F2 Undo

xmodmap -e 'keycode 126=F24' #F3 Redo

xmodmap -e 'keycode 120=F25' #F5 Open

xmodmap -e 'keycode 131=F26' #F6 Close

xmodmap -e 'keycode 123=F27' #F7 Reply

xmodmap -e 'keycode 139=F28' #F8 Fwd

xmodmap -e 'keycode 134=F29' #F9 Send

xmodmap -e 'keycode 121=F30' #F10 Spell

xmodmap -e 'keycode 122=F31' #F11 Save

xmodmap -e 'keycode 133=F32' #F12 Print

```

Save this as "~/.kde/Autostart/keycodes, locate it in Konqueror and make it executable. Run it.

Finally, ensure that your keyboard section in /etc/X11/XF86Config (it is headed:

```

Section "InputDevice"

```

and has a line under that which says:

```

Driver "Keyboard"

```

.) contains the line:

```

Option "XkbModel" "microsoftpro"

```

Because there were literally not enough keycodes to assign every key on the board, (shortfall was 2,) I got the Help key to duplicate F1 (as this is what F1 generally does anyway) and set "New" as "Compose", which means that if you press it, followed by, say, "~" and "a" you get "ã".

Anyway, using KHotKeys should now allow you to allocate them all to something useful!

----------

