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

new Apple symbols map (exposes kernel buglets?)



Hi all,

  After the long discussions about the needs of the Apple keyboard, especially 
the laptops (iBook and PowerBook), I have a new version of the apple symbol 
map attached here.

  This should be interesting to anyone with an Apple laptop with the mimized 
keyboard <apple(laptop)>. It's also mildly interesting to anyone with an 
Apple desktop keyboard (though it only enables the Help key at the moment) 
<apple(extended)>. Also, for those with non-US keyboards who are used to the 
Mac OS way of getting the third engraved character, there is a symbol map for 
you <apple(macos_alt)>.

  I would appriciate it if everyone here could try to install it and use it, 
and let me know how it works for you.

  To install it, just copy this file (called 'apple') to 
/etc/X11/xkb/symbols/apple. Then run setxkbmap -v 10 to see what your current 
symbols are:

$ setxkbmap -v 10
Setting verbose level to 10
locale is C
Applied rules from xfree86:
model:      macintosh
layout:     us
Trying to build keymap using the following components:
keycodes:   xfree86
types:      complete
compat:     complete
symbols:    macintosh/us(extended)
geometry:   macintosh(macintosh)

Then re-run setxkbmap to add +apple(laptop) to your symbols:

$ setxkbmap -v 10 -symbols 'macintosh/us(extended)+apple(laptop)'
Setting verbose level to 10
locale is C
Warning! Multiple definitions of symbols
         Using command line, ignoring rules file
Applied rules from xfree86:
model:      macintosh
layout:     us
Trying to build keymap using the following components:
keycodes:   xfree86
types:      complete
compat:     complete
symbols:    macintosh/us(extended)+apple(laptop)
geometry:   macintosh(macintosh)

Unfortunately, I can't seem to configure XFree86 to take this (or any) 
XkbSymbols option. If someone figures it out, please let me know.

  Also, while trying to create this map, I've run across some buglets (perhaps 
in the kernel keyboard code) that prevent this map from being complete. I've 
noted the problems in the file, but basically, the laptop 'Menu' key, and the 
externded keyboards F13, F14, & F15 keys don't give the expected keycodes. 
The keycode for the right logo key was broken in kernel 2.4.19, but is fixed 
in 2.4.21, but I can't find the location of the fix.

Anyway, please try this out and let me know how it goes.

Frank


//
// Keyboard modification for Apple keyboards
//
// $Xfree86: $

partial default modifier_keys
xkb_symbols "extended" {

// Keypad equal is buggy on XFree 4.3.
//    key <KPEQ> { [ KP_Equal ] }; 
    key  <INS> { [ Help ] };
// The keys next to F12, labeled F13, F14, & F15 generate codes that XFree86
// claims not to generate. I think they should be equivalent to the PC keys
// Print Screen / SysRq, Scroll Lock, and Pause, but there may be a kernel bug.
//    key <PRSC> { [ F13 ] }; // keycode 93
//    key <SCLK> { [ F14 ] }; // keycode 123
//    key <PAUS> { [ F15 ] }; // keycode 127
};

partial modifier_keys
xkb_symbols "laptop" {

    include "apple(extended)"

    // The real numlock key on the iBook (shared with F5) illuminates the
    // Num_Lock led and locks the fn-key to type only the keypad keys on the
    // letter keys (U=4, I=5, O=6, P=*, etc.). This happens internally to the
    // keyboard. Instead the key generates Clear.
    override key <NMLK> { [ Clear ] };
    // The key labeled Delete sends BKSP. To get Delete, use Shift-Delete
    override key <BKSP> { [ BackSpace, Delete ] };
    // These keyboards only generate a <RALT> when pressing fn+Alt. This makes
    // it impossible to get to the third shift level on keys that are on
    // the fn-keypad, so use the Enter key (right of <SPC>) for Mode_switch,
    // and use fn+Enter (Apple's code for Menu) for KP_Enter.
    replace key <KPEN> { [ Mode_switch ] };
    // kernel bug with Menu on macs means this doesn't work yet
//    replace key <MENU> { [ KP_Enter ] }; // should be keycode 117
};

// Outside the US, Apple keyboards use the Alt key to type the third glyph
// on each key. macos_alt allows that behavior in X, instead using the
// Apple-logo key for Meta.
partial modifier_keys
xkb_symbols "macos_alt" {
    key <LALT> { [ Mode_switch ] };
    key <LWIN> { [ Meta_L ] };

    modifier_map Mod1 { Meta_L, Meta_R };
};

Reply to: