• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Keyboard modification for Apple keyboards
3//
4
5partial default modifier_keys
6xkb_symbols "extended" {
7
8    key <KPEQ> { [ KP_Equal ] };
9
10// The key in the PC's Insert position is sometimes engraved Help (at least
11// in Switzerland and Great Britain), with Insert sometimes above. But in the
12// US and Canada, it remains Insert. So this should probably be an XkbOption,
13// but I have to do more research.
14// Perhaps Help should be the primary symbol with Insert in the 1st shift-level
15//    key  <INS> { [ Help, Insert ] };
16// The keys next to F12, labeled F13, F14, & F15 generate codes that XFree86
17// claims not to generate. I think they should be equivalent to the PC keys
18// Print Screen / SysRq, Scroll Lock, and Pause. Linux kernel bug?
19//    key <PRSC> { [ F13 ] }; // should be keycode 93 or
20//    key <FK13> { [ F13 ] }; // should be keycode 118
21//    key <SCLK> { [ F14 ] }; // should be keycode 123 or
22//    key <FK14> { [ F14 ] }; // should be keycode 119
23//    key <PAUS> { [ F15 ] }; // should be keycode 127 or
24//    key <FK15> { [ F15 ] }; // should be keycode 120
25};
26
27partial modifier_keys
28xkb_symbols "laptop" {
29
30    include "macintosh_vndr/apple(extended)"
31
32    // The real numlock key on the iBook (shared with F5) works internally to
33    // the keyboard. It illuminates the Num_Lock led and locks the fn-key to
34    // type only the keypad keys on the letter keys (U=4, I=5, O=6, P=*, etc.).
35    // The key in the Num_lock position is engraved with Clear.
36    override key <NMLK> { [ Clear ] };
37    // The key engraved Delete sends BKSP. To get Delete, use Shift-Delete
38    override key <BKSP> { [ BackSpace, Delete ] };
39    // These keyboards only generate a <RALT> when pressing fn+Alt. This makes
40    // it impossible to get to the third shift level on keys that are on
41    // the fn-keypad, so use the Enter key (right of <SPC>) for Mode_switch,
42    // and use fn+Enter (Apple's code for Menu) for KP_Enter.
43    replace key <KPEN> { [ ISO_Level3_Shift ] };
44    modifier_map Mod5  { ISO_Level3_Shift };
45    // Linux kernel bug with Menu on macs means this doesn't work yet
46//    replace key <MENU> { [ KP_Enter ] }; // should be keycode 117
47};
48
49partial modifier_keys
50xkb_symbols "laptop_bad_switch" {
51    // Kept for backward compatibility
52    include "macintosh_vndr/apple(laptop)"
53};
54
55// Long Aluminium Keyboards
56partial function_keys
57xkb_symbols "alukbd" {
58    // The base is a inet PC keyboard
59    include "pc"
60
61    // Additional Fxx keys
62    key <FK13> { [ F13 ] };
63    key <FK14> { [ F14 ] };
64    key <FK15> { [ F15 ] };
65    key <FK16> { [ F16 ] };
66    key <FK17> { [ F17 ] };
67    key <FK18> { [ F18 ] };
68    key <FK19> { [ F19 ] };
69
70    // On aluminium keyboards, Num_Lock is replace by Clear
71    replace key <NMLK> { [ Clear ] };
72    // CAPS key is always Caps_Lock, even for JIS keyboards
73    replace key <CAPS> { [ Caps_Lock ] };
74
75    // F1..F12 are multimedia keys when used with the 'Fn' key
76    // Make those multimedia actions available via ISO_Level3_Shift too,
77    // it is useful when the Fn key is remapped to something else (e.g. Insert)
78    key <FK01> {
79      type= "FOUR_LEVEL_X",
80      symbols[Group1]= [ NoSymbol, XF86KbdBrightnessDown, NoSymbol, XF86_Switch_VT_1 ]
81    };
82    key <FK02> {
83      type= "FOUR_LEVEL_X",
84      symbols[Group1]= [ NoSymbol, XF86KbdBrightnessUp, NoSymbol, XF86_Switch_VT_2 ]
85    };
86    key <FK03> {
87      type= "FOUR_LEVEL_X",
88      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_3 ]
89    };
90    key <FK04> {
91      type= "FOUR_LEVEL_X",
92      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_4 ]
93    };
94    key <FK05> {
95      type= "FOUR_LEVEL_X",
96      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_5 ]
97    };
98    key <FK06> {
99      type= "FOUR_LEVEL_X",
100      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_6 ]
101    };
102    key <FK07> {
103      type= "FOUR_LEVEL_X",
104      symbols[Group1]= [ NoSymbol, XF86AudioPrev, NoSymbol, XF86_Switch_VT_7 ]
105    };
106    key <FK08> {
107      type= "FOUR_LEVEL_X",
108      symbols[Group1]= [ NoSymbol, XF86AudioPlay, NoSymbol, XF86_Switch_VT_8 ]
109    };
110    key <FK09> {
111      type= "FOUR_LEVEL_X",
112      symbols[Group1]= [ NoSymbol, XF86AudioNext, NoSymbol, XF86_Switch_VT_9 ]
113    };
114    key <FK10> {
115      type= "FOUR_LEVEL_X",
116      symbols[Group1]= [ NoSymbol, XF86AudioMute, NoSymbol, XF86_Switch_VT_10 ]
117    };
118    key <FK11> {
119      type= "FOUR_LEVEL_X",
120      symbols[Group1]= [ NoSymbol, XF86AudioLowerVolume, NoSymbol, XF86_Switch_VT_11 ]
121    };
122    key <FK12> {
123      type= "FOUR_LEVEL_X",
124      symbols[Group1]= [ NoSymbol, XF86AudioRaiseVolume, NoSymbol, XF86_Switch_VT_12 ]
125    };
126};
127
128// Aluminium Keyboard: make F13, F14, F15 PC-ish (Print, Scroll_Lock, Pause)
129partial function_keys keypad_keys
130xkb_symbols "alupckeys" {
131    key <FK13> {
132      type= "PC_ALT_LEVEL2",
133      symbols[Group1]= [ Print, Sys_Req ]
134    };
135    key <FK14> { [ Scroll_Lock ] };
136    key <FK15> {
137      type= "PC_CONTROL_LEVEL2",
138      symbols[Group1]= [ Pause, Break ]
139    };
140    override key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
141};
142