[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using special keys on a keyboard



Thibaut Cousin <cousin@in2p3.fr> wrote:
>  I recently got a new keyboard with several special keys to power off the
>computer, launch the mailer, etc. I'd like to make them work under Linux (I'm
>using Potato).
>  When I press them at boot time, I get on screen a message "unknown scancode"
>with a code "e0 xx". But I fear these codes are only for the console, not for
>X. So :
>	- how do I get the codes of these keys for X ? xkeycaps doesn't work,
>	  as it only knows standard keyboards.
>	- where can I configure their action ? Is there a tool to do it ?

I can't help you for X, I'm afraid; I did get a few extra keys on my
keyboard working at the console, though. Have a look at setkeycodes(8);
with the aid of showkey(1) you'll be able to assign arbitrary scancodes
to arbitrary keycodes. You'll need to find a keycode that's currently
unassigned.

You'll need to fiddle with your init.d scripts in order to get this
working, though - I think /etc/init.d/keymaps-lct.sh is a reasonable
place to put this sort of thing, or you could write your own and link it
into /etc/rcS.d. (Hmm, maybe Debian needs its own tool for this kind of
thing ...)

At the console, you can configure the action of extra keys using
dumpkeys(1) and loadkeys(1), and perhaps it would be worth looking at
the "READLINE" section in the bash(1) man page to see if that's any use
to you. X is substantially more fiddly - I'd be interested to hear from
any X experts who actually understand XKB ...

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Reply to: