2 # hypermap.map 1994/11/11
3 # Michael Shields <shields@tembel.org>
5 # A keymap redesigned for sanity.
9 # This keymap is a ground-up reimplementation of the keyboard map,
10 # intended to be consistent and rational. It uses an m4 metalanguage to
11 # declare the key mappings. Usage is `m4 hypermap.map | loadkeys'.
13 # The modifier flags used are `shift' (1), `control' (4), and `alt' (8).
14 # Left and right modifiers are not distinguished.
16 # In general, Meta is always distinguished, and M-S-KEY is distinct from
17 # M-KEY. This is good news for Emacs users. C-S-KEY is consistently
20 # Shift is more loosely interpreted than the other modifiers; usually if
21 # S-KEY has no special meaning, the action will be the same as KEY.
22 # However, if M-KEY or H-KEY is undefined, nothing happens.
24 # Because Caps Lock's position is so out of proportion to its utility,
25 # it's been totally redefined to a new sort of modifier, which I've
26 # arbitrarily named `Hyper'. Shift is ignored with Hyper. Hyper
28 # H-` dead accent grave
29 # H-' dead acute accent
33 # and ISO-8859-1 symbols (some more mnemonic than others):
36 # H-h cents (`hundredths')
41 # H-s section (the galaxy symbol)
43 # H-a feminine ordinal
45 # H-] not sign (it's angular)
47 # H-r registered trademark symbol
50 # H-[ plus/minus (near + and -)
51 # H-k superior 2 (jkl form a series)
57 # H-o masculine ordinal
59 # H-q 1/4 fraction (qwe form a series)
62 # H-? inverted question mark
63 # H-x multiplication symbol
65 # You can also use Hyper plus Alt to type characters by decimal code on
66 # the keypad, as with Alt alone, or in hex on the main keyboard. And
67 # H-TAB is a Caps Lock.
69 # Function keys work as marked, unless with Alt, in which case they
70 # switch to the console with the same number. Shift adds 12 and Hyper
71 # adds 24 to the numbers (i.e., they logically switch to other banks).
72 # Thus you can easily address up to 48. Control is ignored, for
75 # Finally, you can change the behavior of the Caps Lock and Controls
76 # with m4 command-line options. The default values are equivalent to
77 # `-DCAPSLOCK_K=Hyper -DLEFTCTRL_K=Control -DRIGHTCTRL_K=Control'. You
78 # can remove the Hyper code entirely with `-DCAPSLOCK_K=Caps_Lock'.
80 # This file is arranged vaguely by key position on the classic PC layout.
84 dnl Set default values.
85 ifdef(`CAPSLOCK_K', , `define(`CAPSLOCK_K', `Hyper')')
86 ifdef(`LEFTCTRL_K', , `define(`LEFTCTRL_K', `Control')')
87 ifdef(`RIGHTCTRL_K', , `define(`RIGHTCTRL_K', `Control')')
89 dnl Figure out if any key is a Hyper key. If so, define `hyper', both
90 dnl for usefulness and `ifdef' testability.
91 ifelse(CAPSLOCK_K, `Hyper', `define(`hyper', `ctrlr')',
92 LEFTCTRL_K, `Hyper', `define(`hyper', `ctrlr')',
93 RIGHTCTRL_K, `Hyper', `define(`hyper', `ctrlr')')
95 define(`Hyper', `CtrlR')
98 keymaps 0,1,4,5,8,9,12,13`'ifdef(`hyper', `,128,129,132,133,136,137,140,141')
101 dnl General usage of these macros is MACRO(KEYCODE, UNSHIFTED, SHIFTED).
103 dnl We first undefine `shift', which only causes problems.
106 define(`SIMPLE', `keycode $1 = $2 $2')
109 ` keycode $1 = $2 VoidSymbol
110 shift keycode $1 = $3
111 alt keycode $1 = Meta_$2
112 shift alt keycode $1 = Meta_$3')
114 dnl This macro adds Control variations to a key.
116 ` control keycode $1 = $2
117 shift control keycode $1 = $2
118 control alt keycode $1 = Meta_$2
119 shift control alt keycode $1 = Meta_$2')
121 dnl Add Hyper variations to a key.
122 define(`HYPER', ifdef(`hyper',
123 ` hyper keycode $1 = $2
124 shift hyper keycode $1 = $2'))
125 define(`CONTROLHYPER', ifdef(`hyper',
126 ` control hyper keycode $1 = $2
127 shift control hyper keycode $1 = $2'))
128 define(`METAHYPER', ifdef(`hyper',
129 ` alt hyper keycode $1 = $2
130 shift alt hyper keycode $1 = $2'))
131 define(`CONTROLMETAHYPER', ifdef(`hyper', dnl Ludicrous.
132 ` control alt hyper keycode $1 = $2
133 shift control alt hyper keycode $1 = $2'))
135 dnl Special case for letters. Best to be explicit.
137 ` keycode $1 = `+'$2 VoidSymbol
138 shift keycode $1 = `+'translit($2, `a-z', `A-Z')
139 alt keycode $1 = `Meta_'$2
140 shift alt keycode $1 = `Meta_'translit($2, `a-z', `A-Z')
141 CONTROL($1, Control_$2)')
143 dnl For function keys. Call here is FUNCTION(KEYCODE, FKEYNUM).
144 define(`BANKSIZE', 12)
146 ` keycode $1 = `F'$2 VoidSymbol
147 shift keycode $1 = `F'eval($2 + BANKSIZE)
148 hyper keycode $1 = `F'eval($2 + BANKSIZE * 2)
149 shift hyper keycode $1 = `F'eval($2 + BANKSIZE * 3)
150 alt keycode $1 = `Console_'$2
151 shift alt keycode $1 = `Console_'eval($2 + BANKSIZE)
152 hyper alt keycode $1 = `Console_'eval($2 + BANKSIZE * 2)
153 shift hyper alt keycode $1 = `Console_'eval($2 + BANKSIZE * 3)')
155 dnl For the keypad digits. KPDIGIT(KEYCODE, DIGIT).
157 ` keycode $1 = KP_$2 VoidSymbol
158 shift keycode $1 = KP_$2
159 alt keycode $1 = Ascii_$2
160 shift alt keycode $1 = Ascii_$2
161 METAHYPER($1, Ascii_$2)')
163 dnl And a special approximation:
164 define(`Meta_Return', `Meta_Control_m')
167 KEY(1, Escape, Escape)
188 KEY(4, three, numbersign)
194 KEY(6, five, percent)
197 KEY(7, six, asciicircum)
198 CONTROL(7, Control_asciicircum)
199 HYPER(7, dead_circumflex)
201 KEY(8, seven, ampersand)
203 KEY(9, eight, asterisk)
205 KEY(10, nine, parenleft)
207 KEY(11, zero, parenright)
210 KEY(12, minus, underscore)
211 CONTROL(12, Control_underscore)
215 KEY(14, Delete, Delete)
216 CONTROL(14, BackSpace)
221 HYPER(16, onequarter)
225 HYPER(18, threequarters)
228 HYPER(19, registered)
230 HYPER(20, dead_tilde)
239 HYPER(25, 182) # pilcrow
240 KEY(26, bracketleft, braceleft)
243 KEY(27, bracketright, braceright)
244 CONTROL(27, Control_bracketright)
247 KEY(28, Return, Return)
250 HYPER(30, ordfeminine)
255 HYPER(32, dead_diaeresis)
263 HYPER(36, onesuperior)
265 HYPER(37, twosuperior)
267 HYPER(38, threesuperior)
268 KEY(39, semicolon, colon)
269 HYPER(39, periodcentered)
270 KEY(40, apostrophe, quotedbl)
271 HYPER(40, dead_acute)
272 KEY(41, grave, asciitilde)
273 HYPER(41, dead_grave)
275 KEY(43, backslash, bar)
276 CONTROL(43, Control_backslash)
280 HYPER(45, multiplication)
290 HYPER(51, guillemotleft)
291 KEY(52, period, greater)
292 HYPER(52, guillemotright)
293 KEY(53, slash, question)
294 HYPER(53, questiondown)
296 KEY(57, space, space)
298 HYPER(57, nobreakspace)
303 SIMPLE(74, KP_Subtract)
312 SIMPLE(83, KP_Period)
314 SIMPLE(98, KP_Divide)
315 SIMPLE(55, KP_Multiply)
316 SIMPLE(118, KP_MinPlus)
323 keycode 58 = CAPSLOCK_K
324 keycode 29 = LEFTCTRL_K
325 keycode 97 = RIGHTCTRL_K
327 # Everyone needs a compose key. This is C-..
328 control keycode 52 = Compose
332 keycode 70 = Scroll_Lock
333 shift keycode 70 = Show_Memory
334 control keycode 70 = Show_State
335 alt keycode 70 = Show_Registers
337 # SysRq. I suppose there's some reason it's ^\.
338 SIMPLE(99, Control_backslash)
341 # Ctrl-Break seems to have low-level hardware behind it.
346 keycode 104 = Prior Scroll_Backward
349 keycode 109 = Next Scroll_Forward
353 alt keycode 105 = Decr_Console
355 alt keycode 106 = Incr_Console
358 control alt keycode 83 = Boot
359 control alt keycode 111 = Boot
362 # Stock VT102 string definitions.
363 string F1 = "\033[[A"
364 string F2 = "\033[[B"
365 string F3 = "\033[[C"
366 string F4 = "\033[[D"
367 string F5 = "\033[[E"
368 string F6 = "\033[17~"
369 string F7 = "\033[18~"
370 string F8 = "\033[19~"
371 string F9 = "\033[20~"
372 string F10 = "\033[21~"
373 string F11 = "\033[23~"
374 string F12 = "\033[24~"
375 string F13 = "\033[25~"
376 string F14 = "\033[26~"
377 string F15 = "\033[28~"
378 string F16 = "\033[29~"
379 string F17 = "\033[31~"
380 string F18 = "\033[32~"
381 string F19 = "\033[33~"
382 string F20 = "\033[34~"
383 string Find = "\033[1~"
384 string Insert = "\033[2~"
385 string Remove = "\033[3~"
386 string Select = "\033[4~"
387 string Prior = "\033[5~"
388 string Next = "\033[6~"
389 string Macro = "\033[M"
390 string Pause = "\033[P"
392 # Stock ISO-8859-1 compositions.
394 compose '`' 'A' to 'À'
395 compose '`' 'a' to 'à'
396 compose '\'' 'A' to 'Á'
397 compose '\'' 'a' to 'á'
398 compose '^' 'A' to 'Â'
399 compose '^' 'a' to 'â'
400 compose '~' 'A' to 'Ã'
401 compose '~' 'a' to 'ã'
402 compose '"' 'A' to 'Ä'
403 compose '"' 'a' to 'ä'
404 compose 'O' 'A' to 'Å'
405 compose 'o' 'a' to 'å'
406 compose '0' 'A' to 'Å'
407 compose '0' 'a' to 'å'
408 compose 'A' 'A' to 'Å'
409 compose 'a' 'a' to 'å'
410 compose 'A' 'E' to 'Æ'
411 compose 'a' 'e' to 'æ'
412 compose ',' 'C' to 'Ç'
413 compose ',' 'c' to 'ç'
414 compose '`' 'E' to 'È'
415 compose '`' 'e' to 'è'
416 compose '\'' 'E' to 'É'
417 compose '\'' 'e' to 'é'
418 compose '^' 'E' to 'Ê'
419 compose '^' 'e' to 'ê'
420 compose '"' 'E' to 'Ë'
421 compose '"' 'e' to 'ë'
422 compose '`' 'I' to 'Ì'
423 compose '`' 'i' to 'ì'
424 compose '\'' 'I' to 'Í'
425 compose '\'' 'i' to 'í'
426 compose '^' 'I' to 'Î'
427 compose '^' 'i' to 'î'
428 compose '"' 'I' to 'Ï'
429 compose '"' 'i' to 'ï'
430 compose '-' 'D' to 'Ð'
431 compose '-' 'd' to 'ð'
432 compose '~' 'N' to 'Ñ'
433 compose '~' 'n' to 'ñ'
434 compose '`' 'O' to 'Ò'
435 compose '`' 'o' to 'ò'
436 compose '\'' 'O' to 'Ó'
437 compose '\'' 'o' to 'ó'
438 compose '^' 'O' to 'Ô'
439 compose '^' 'o' to 'ô'
440 compose '~' 'O' to 'Õ'
441 compose '~' 'o' to 'õ'
442 compose '"' 'O' to 'Ö'
443 compose '"' 'o' to 'ö'
444 compose '/' 'O' to 'Ø'
445 compose '/' 'o' to 'ø'
446 compose '`' 'U' to 'Ù'
447 compose '`' 'u' to 'ù'
448 compose '\'' 'U' to 'Ú'
449 compose '\'' 'u' to 'ú'
450 compose '^' 'U' to 'Û'
451 compose '^' 'u' to 'û'
452 compose '"' 'U' to 'Ü'
453 compose '"' 'u' to 'ü'
454 compose '\'' 'Y' to 'Ý'
455 compose '\'' 'y' to 'ý'
456 compose 'T' 'H' to 'Þ'
457 compose 't' 'h' to 'þ'
458 compose 's' 's' to 'ß'
459 compose '"' 'y' to 'ÿ'
460 compose 's' 'z' to 'ß'
461 compose 'i' 'j' to 'ÿ'
463 # ISO-8859-3 compositions for Esperanto.
464 compose 'C' 'x' to 'Æ' #198
465 compose 'G' 'x' to 'Ø' #216
466 compose 'H' 'x' to '¦' #166
467 compose 'J' 'x' to '¬' #172
468 compose 'S' 'x' to 'Þ' #222
469 compose 'U' 'x' to 'Ý' #221
470 compose 'c' 'x' to 'æ' #230
471 compose 'g' 'x' to 'ø' #248
472 compose 'h' 'x' to '¶' #182
473 compose 'j' 'x' to '¼' #188
474 compose 's' 'x' to 'þ' #254
475 compose 'u' 'x' to 'ý' #253