Setting up an Apple wireless keyboard

Phil Endecott spam_from_xorg at chezphil.org
Tue Apr 22 11:00:24 PDT 2008


Dear Experts,

I'm typing this on an Apple wireless keyboard.  If you're looking for a 
small keyboard (i.e. to minimise the distance that you have to move 
your arm to reach the mouse), it could be a good choice.  But I need to 
remap a few keys to make it usable.  Can anyone help?  Here's what I 
want to do:

- There's no delete key.  I'd like to remap what I think is an eject 
key to delete; it currently reports keycode 204 in xev.  This should be 
easy :-)

- There are no page up, page down, home or end keys.  I'd like to make 
FN plus cursor keys implement these.  This is interesting, as on 
another small keyboard that I have it seemed as if the FN key had a 
hardcoded behaviour implemented within the keyboard itself.  This is 
not the case with this keyboard; although xev doesn't report anything 
when I press FN, I do see events in /dev/input/eventN with keycode 
0x1d0.  But there's also the question of whether the keys at the 
bottom-left of the keyboard should be ordered FN then CTRL or CTRL then 
FN; one option is to make them both CTRL, and to make CTRL plus cursor 
return pgup etc.  (This breaks any applications that actually use 
ctrl+cursor for something; I've just discovered that it does word 
left/right in this webmail.  Hmm.)

- Some of the punctuation keys are in odd places (this is a UK 
layout).  I think that I need to swap keycodes 94 and 49.

- The order of the keys to the left of the spacebar is different; on my 
PC it's ctrl-logo-alt, on this keyboard it's ctrl-alt-logo.  I'd like 
to swap the alt and logo keys.

My aim here is to make it close enough to a PC keyboard that I can 
still use a PC without constantly pressing the wrong keys.  I'm not 
likely to ever want to type on a real Mac.  So I want to implement 
these changes, but only for this keyboard.  When I use another keyboard 
I don't when these changes to apply.  Well, I'll probably want the 
fn+cursor=pgup to happen as I'll get used to that.

So, how do I configure X to apply changes to only a particular 
keyboard?  At present I just have a single 'Section InputDevice' in my 
xorg.conf.  Should I keep this as the default for any PC keyboards, and 
add a second one that uses 'Option Device' to match just this keyboard?

Ideally I'd like the same behaviour at the console.  I have a vague 
recollection that changes made to the console keymap are supposed to be 
understood by X, but I never got that to work.  Am I imagining that?

Many thanks in advance for any suggestions.


Phil.







More information about the xorg mailing list