[plug] Using those Extra Keys under X.

Mike Roberts mroberts at it.net.au
Tue Nov 27 12:28:59 WST 2001


* Trevor Phillips (T.Phillips at murdoch.edu.au) wrote:
> 
> I've recently changed my keyboard, and the new one (a Dell Workstation one) 
> has some extra keys - you know, for Mail, Home, etc... It'd be nice to 
> actually make use of these under X (and specifically, under KDE 2.2.2).
> 
> Using xev to spy on X Events, I can see that these extra keys do produce a 
> keycode event, but the keysym is blank.
> 
> What's the easiest way to bind these extra keycodes to useful things? Can you 
> map them to other combos? (eg; Can you map buttonx to be the equivalent of 
> Ctrl+Alt+X?)

I have bound the extra buttons on my keyboard to events by using xmodmap
and e16keyedit (i don't know if kde has an equivelent). Using the
keycodes generated by xev you can bind them to XKeySym's. The possible 
XKeySym's are listed in /usr/X11R6/lib/X11/XKeysymDB on my Debian system. 

Then its a case of generating an .xmodmap file, which has the syntax

keycode xxx = XKeySym

where xxx is the keycode you found using xev, and XKeySym is the KeySym
you want to bind it to. An example from my config would be :

keycode 153 = XF86AudioNext

You will need to load this xmodmap file every time you start X with
'xmodmap ~/.xmodmap'.

Then you just need to get the WM to deal with this key event. Having
never used KDE i don't know how to do this sorry.

> Similarly, can you map Mouse Button events (eg; extra buttons on the new 
> mice) to keypress combos?
> 
> Thanks...

Michael Roberts   <mroberts at it.net.au>    <http://home.it.net.au/~mroberts>
--
Perilous to all of us are the devices of an art deeper than we ourselves
possess.
        -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]



More information about the plug mailing list