• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1hidden partial keypad_keys
2xkb_symbols "overlay" {
3    include "keypad(overlay1)"
4};
5
6hidden partial keypad_keys
7xkb_symbols "overlay1" {
8
9    key  <KP7> {	[  KP_Home	],	overlay1=<KO7>	};
10    key  <KP8> {	[  KP_Up	],	overlay1=<KO8>	};
11    key  <KP9> {	[  KP_Prior	],	overlay1=<KO9>	};
12
13    key  <KP4> {	[  KP_Left	],	overlay1=<KO4>	};
14    key  <KP5> {	[  KP_Begin	],	overlay1=<KO5>	};
15    key  <KP6> {	[  KP_Right	],	overlay1=<KO6>	};
16
17    key  <KP1> {	[  KP_End	],	overlay1=<KO1>	};
18    key  <KP2> {	[  KP_Down	],	overlay1=<KO2>	};
19    key  <KP3> {	[  KP_Next	],	overlay1=<KO3>	};
20
21    key  <KP0> {	[  KP_Insert	],	overlay1=<KO0>	};
22    key <KPDL> {	[  KP_Delete	],	overlay1=<KODL>	};
23
24    key  <KO7> {	[  KP_7	]	};
25    key  <KO8> {	[  KP_8	]	};
26    key  <KO9> {	[  KP_9	]	};
27
28    key  <KO4> {	[  KP_4	]	};
29    key  <KO5> {	[  KP_5	]	};
30    key  <KO6> {	[  KP_6	]	};
31
32    key  <KO1> {	[  KP_1	]	};
33    key  <KO2> {	[  KP_2	]	};
34    key  <KO3> {	[  KP_3	]	};
35
36    key  <KO0> {	[  KP_0	]	};
37    key <KODL> {	[  KP_Decimal ]	};
38};
39
40hidden partial keypad_keys
41xkb_symbols "overlay2" {
42
43    key  <KP7> {	[  KP_Home	],	overlay2=<KO7>	};
44    key  <KP8> {	[  KP_Up	],	overlay2=<KO8>	};
45    key  <KP9> {	[  KP_Prior	],	overlay2=<KO9>	};
46
47    key  <KP4> {	[  KP_Left	],	overlay2=<KO4>	};
48    key  <KP5> {	[  KP_Begin	],	overlay2=<KO5>	};
49    key  <KP6> {	[  KP_Right	],	overlay2=<KO6>	};
50
51    key  <KP1> {	[  KP_End	],	overlay2=<KO1>	};
52    key  <KP2> {	[  KP_Down	],	overlay2=<KO2>	};
53    key  <KP3> {	[  KP_Next	],	overlay2=<KO3>	};
54
55    key  <KP0> {	[  KP_Insert	],	overlay2=<KO0>	};
56    key <KPDL> {	[  KP_Delete	],	overlay2=<KODL>	};
57
58    key  <KO7> {	[  KP_7	]	};
59    key  <KO8> {	[  KP_8	]	};
60    key  <KO9> {	[  KP_9	]	};
61
62    key  <KO4> {	[  KP_4	]	};
63    key  <KO5> {	[  KP_5	]	};
64    key  <KO6> {	[  KP_6	]	};
65
66    key  <KO1> {	[  KP_1	]	};
67    key  <KO2> {	[  KP_2	]	};
68    key  <KO3> {	[  KP_3	]	};
69
70    key  <KO0> {	[  KP_0	]	};
71    key <KODL> {	[  KP_Decimal ]	};
72};
73
74hidden partial keypad_keys
75xkb_symbols "operators" {
76    // Puts some commands to control the X server on
77    // the fifth level of the keypad's operator keys.
78    key <KPDV> {
79        type="CTRL+ALT",	// Ungrab cancels server/keyboard/pointer grabs
80        symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86_Ungrab ]
81    };
82    key <KPMU> {
83        type="CTRL+ALT",	// ClsGrb kills whichever client has a grab in effect
84        symbols[Group1]= [ KP_Multiply,	KP_Multiply, KP_Multiply, KP_Multiply, XF86_ClearGrab ]
85    };
86    key <KPSU> {
87        type="CTRL+ALT",	// -VMode switches to the previous video mode
88        symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86_Prev_VMode ]
89    };
90    key <KPAD> {
91        type="CTRL+ALT",	// +VMode switches to the next video mode
92        symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86_Next_VMode ]
93    };
94};
95
96default  hidden partial keypad_keys
97xkb_symbols "x11" {
98
99    include "keypad(operators)"
100
101    key  <KP7> {	[  KP_Home,	KP_7	]	};
102    key  <KP8> {	[  KP_Up,	KP_8	]	};
103    key  <KP9> {	[  KP_Prior,	KP_9	]	};
104
105    key  <KP4> {	[  KP_Left,	KP_4	]	};
106    key  <KP5> {	[  KP_Begin,	KP_5	]	};
107    key  <KP6> {	[  KP_Right,	KP_6	]	};
108
109    key  <KP1> {	[  KP_End,	KP_1	]	};
110    key  <KP2> {	[  KP_Down,	KP_2	]	};
111    key  <KP3> {	[  KP_Next,	KP_3	]	};
112    key <KPEN> {	[	KP_Enter	]	};
113    key <KPEQ> {	[	KP_Equal	]	};
114
115    key  <KP0> {	[  KP_Insert,	KP_0	]	};
116    key <KPDL> {	[  KP_Delete,	KP_Decimal ]	};
117    key <KPPT> {	[  KP_Decimal,	KP_Decimal ]	};
118};
119
120
121// Legacy PC keypad definition
122// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
123keypad_keys
124xkb_symbols "legacy" {
125
126    include "keypad(core)"
127    include "keypad(legacymath)"
128    include "keypad(legacynumber)"
129    include "kpdl(dot)"
130};
131
132
133// Legacy Wang 725-3771-ae and 725-3771-uk keypad definition
134// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
135keypad_keys
136xkb_symbols "legacy_wang" {
137
138    include "keypad(core)"
139    include "keypad(legacymath)"
140    include "keypad(legacynumber_wang)"
141    include "kpdl(dot)"
142};
143
144
145// Complete new keypad definition
146// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
147keypad_keys
148xkb_symbols "oss" {
149
150    include "keypad(core)"
151    include "keypad(ossmath)"
152    include "keypad(ossnumber)"
153    include "kpdl(dotoss)"
154};
155
156
157// Latin9 restriction of new keypad definition
158// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
159keypad_keys
160xkb_symbols "oss_latin9" {
161
162    include "keypad(core)"
163    include "keypad(ossmath_latin9)"
164    include "keypad(legacynumber)"
165    include "kpdl(dotoss_latin9)"
166};
167
168
169// Wang 725-3771-ae and 725-3771-uk keypad variant of oss keypad
170// Copyright © 2006-2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
171keypad_keys
172xkb_symbols "oss_wang" {
173
174    include "keypad(core)"
175    include "keypad(ossmath)"
176    include "keypad(ossnumber_wang)"
177    include "kpdl(dotoss)"
178};
179
180
181// Forward-looking keypad definition
182// Won't work with applications that make ASCII assumptions
183// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
184keypad_keys
185xkb_symbols "future" {
186
187    include "keypad(core)"
188    include "keypad(futuremath)"
189    include "keypad(ossnumber)"
190    include "kpdl(commaoss)"
191};
192
193
194// Forward-looking keypad definition
195// Won't work with applications that make ASCII assumptions
196// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
197keypad_keys
198xkb_symbols "future_wang" {
199
200    include "keypad(core)"
201    include "keypad(futuremath)"
202    include "keypad(ossnumber_wang)"
203    include "kpdl(commaoss)"
204};
205
206
207// Keypad keys nobody changes
208// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
209partial keypad_keys
210xkb_symbols "core" {
211
212    modifier_map Mod2 { Num_Lock };
213
214    key <NMLK> { [ Num_Lock                     ] };
215    key <KPEN> { [ KP_Enter                     ] };
216    key <KPEQ> { [ KP_Equal                     ] };
217};
218
219
220// Legacy keypad math area
221// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
222//
223// ┏━━━━━┱─────┬─────┬─────┐
224// ┃Num  ┃ ₁   │ ₂   │ ₃   │ ₁ <XF86_Ungrab>
225// ┃Lock⇭┃ /   │ *   │ -   │ ₂ <XF86_ClearGrab>
226// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
227//                   │ ₄   │ ₄ <XF86_Next_VMode>
228//                   │     │
229//                   ┤     │ 1 None
230//                   │     │ 2 Ctrl+Alt
231//                   │ +   │
232//                   ╆━━━━━┪
233partial keypad_keys
234xkb_symbols "legacymath" {
235
236    key.type[Group1]="CTRL+ALT" ;
237
238    key <KPDV> { [   KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86_Ungrab ] }; // / <XF86_Ungrab>
239    key <KPMU> { [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86_ClearGrab ] }; // * <XF86_ClearGrab>
240    key <KPSU> { [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86_Prev_VMode ] }; // - <XF86_Prev_VMode>
241
242    key <KPAD> { [      KP_Add, KP_Add, KP_Add, KP_Add, XF86_Next_VMode ] }; // + <XF86_Next_VMode>
243};
244
245
246// Keypad math area with non-CS operators
247// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
248//
249// ┏━━━━━┱─────┬─────┬─────┐
250// ┃Num  ┃ ∕ ₁ │ . ₂ │ − ₃ │ ₁ <XF86_Ungrab>
251// ┃Lock⇭┃ / ÷ │ * × │ - − │ ₂ <XF86_ClearGrab>
252// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
253//                   │ + ₄ │ ₄ <XF86_Next_VMode>
254//                   │     │
255//                   ┤     │ 1 None
256//                   │     │ 2 Level3 ⇮
257//                   │ + + │ 3 Shift+Level3 ⇧⇮
258//                   ╆━━━━━┪ 4 Ctrl+Alt
259partial keypad_keys
260xkb_symbols "ossmath" {
261
262    key.type[Group1]="CTRL+ALT" ;
263
264    key <KPDV> { [   KP_Divide, 0x1002215, 0x10000F7, VoidSymbol,     XF86_Ungrab ] }; // / ∕ ÷     <XF86_Ungrab>
265    key <KPMU> { [ KP_Multiply, 0x10022C5, 0x10000D7, VoidSymbol,  XF86_ClearGrab ] }; // * ⋅ ×  <XF86_ClearGrab>
266    key <KPSU> { [ KP_Subtract, 0x1002212, 0x1002212, VoidSymbol, XF86_Prev_VMode ] }; // - − − <XF86_Prev_VMode>
267
268    key <KPAD> { [      KP_Add, 0x100002B, 0x100002B, VoidSymbol, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
269};
270
271
272// Keypad math area with non-CS operators in first levels
273// As demanded by users not interested in legacy pre-unicode junk
274// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
275//
276// ┏━━━━━┱─────┬─────┬─────┐
277// ┃Num  ┃ / ₁ │ * ₂ │ - ₃ │ ₁ <XF86_Ungrab>
278// ┃Lock⇭┃ ∕ ÷ │ . × │ − − │ ₂ <XF86_ClearGrab>
279// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
280//                   │ + ₄ │ ₄ <XF86_Next_VMode>
281//                   │     │
282//                   ┤     │ 1 None
283//                   │     │ 2 Level3 ⇮
284//                   │ + + │ 3 Shift+Level3 ⇧⇮
285//                   ╆━━━━━┪ 4 Ctrl+Alt
286partial keypad_keys
287xkb_symbols "futuremath" {
288
289    key.type[Group1]="FOUR_LEVEL_X" ;
290
291    key <KPDV> { [ 0x1002215,   KP_Divide, 0x10000F7,     XF86_Ungrab ] }; // ∕ / ÷     <XF86_Ungrab>
292    key <KPMU> { [ 0x10022C5, KP_Multiply, 0x10000D7,  XF86_ClearGrab ] }; // ⋅ * ×  <XF86_ClearGrab>
293    key <KPSU> { [ 0x1002212, KP_Subtract, 0x1002212, XF86_Prev_VMode ] }; // − - − <XF86_Prev_VMode>
294
295    key <KPAD> { [ 0x100002B,      KP_Add, 0x100002B, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
296};
297
298
299// Keypad math area with non-CS operators, restricted to latin9
300// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
301//
302// ┏━━━━━┱─────┬─────┬─────┐
303// ┃Num  ┃ / ₁ │ · ₂ │ - ₃ │ ₁ <XF86_Ungrab>
304// ┃Lock⇭┃ / ÷ │ * × │ - - │ ₂ <XF86_ClearGrab>
305// ┡━━━━━╃─────┼─────┼─────┤ ₃ <XF86_Prev_VMode>
306//                   │ + ₄ │ ₄ <XF86_Next_VMode>
307//                   │     │
308//                   ┤     │ 1 None
309//                   │     │ 2 Level3 ⇮
310//                   │ + + │ 3 Shift+Level3 ⇧⇮
311//                   ╆━━━━━┪ 4 Ctrl+Alt
312partial keypad_keys
313xkb_symbols "ossmath_latin9" {
314
315    key.type[Group1]="FOUR_LEVEL_X";
316
317    key <KPDV> { [   KP_Divide,          slash, division,     XF86_Ungrab ] }; // / / ÷     <XF86_Ungrab>
318    key <KPMU> { [ KP_Multiply, periodcentered, multiply,  XF86_ClearGrab ] }; // * · ×  <XF86_ClearGrab>
319    key <KPSU> { [ KP_Subtract,          minus,    minus, XF86_Prev_VMode ] }; // - - - <XF86_Prev_VMode>
320
321    key <KPAD> { [      KP_Add,           plus,     plus, XF86_Next_VMode ] }; // + + + <XF86_Next_VMode>
322};
323
324
325// Legacy keypad number area
326// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
327//
328// ┏━━━━━┱
329// ┃Num  ┃                   ⇱ Home
330// ┃Lock⇭┃                   ⇲ End
331// ┡━━━━━╃─────┼─────┼       ⇞ Page up
332// │ 7   │ 8   │ 9   │       ⇟ Page down
333// │ ⇱   │ ⇧   │ ⇞   │       ⎀ Insert
334// ├─────┼─────┼─────┤       ␥ Delete
335// │ 4   │ 5   │ 6   │       ⇦⇧⇨⇩ Directions
336// │ ⇦   │     │ ⇨   │
337// ├─────┼─────┼─────╆
338// │ 1   │ 2   │ 3   ┃
339// │ ⇲   │ ⇩   │ ⇟   ┃       1 None
340// ├─────┴─────┼─────┨       2 Num Lock ⇭
341// │ 0         │
342// │ ⎀         │
343// └───────────┴
344partial keypad_keys
345xkb_symbols "legacynumber" {
346
347    key.type[Group1]="KEYPAD" ;
348
349    key <KP7>  { [   KP_Home,       KP_7 ] }; //   <home> 7
350    key <KP8>  { [     KP_Up,       KP_8 ] }; //     <up> 8
351    key <KP9>  { [  KP_Prior,       KP_9 ] }; //  <prior> 9
352
353    key <KP4>  { [   KP_Left,       KP_4 ] }; //   <left> 4
354    key <KP5>  { [  KP_Begin,       KP_5 ] }; //  <begin> 5
355    key <KP6>  { [  KP_Right,       KP_6 ] }; //  <right> 6
356
357    key <KP1>  { [    KP_End,       KP_1 ] }; //    <end> 1
358    key <KP2>  { [   KP_Down,       KP_2 ] }; //   <down> 2
359    key <KP3>  { [   KP_Next,       KP_3 ] }; //   <next> 3
360
361    key <KP0>  { [ KP_Insert,       KP_0 ] }; // <insert> 0
362};
363
364
365// Legacy Wang 725-3771-ae and 725-3771-uk keypad number area
366// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
367// This is actually a three-level keypad, declared as four-level
368// to avoid defining a new type
369//
370// ┏━━━━━┱
371// ┃Num  ┃                   ⇱ Home
372// ┃Lock⇭┃                   ⇲ End
373// ┡━━━━━╃─────┼─────┼       ⇞ Page up
374// │ 7   │ 8   │ 9   │       ⇟ Page down
375// │ ⇱ < │ ⇧ > │ ⇞ ^ │       ⎀ Insert
376// ├─────┼─────┼─────┤       ␥ Delete
377// │ 4   │ 5   │ 6   │       ⇦⇧⇨⇩ Directions
378// │ ⇦ [ │   ] │ ⇨ $ │
379// ├─────┼─────┼─────╆
380// │ 1   │ 2   │ 3   ┃
381// │ ⇲ & │ ⇩ @ │ ⇟ # ┃       1 None
382// ├─────┴─────┼─────┨       2 Num Lock ⇭
383// │ 0         │             3 Level3 ⇮
384// │ ⎀         │
385// └───────────┴
386partial keypad_keys
387xkb_symbols "legacynumber_wang" {
388
389    key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
390
391    key <KP7>  { [   KP_Home,   KP_7,         less ] }; //   <home> 7 <
392    key <KP8>  { [     KP_Up,   KP_8,      greater ] }; //     <up> 8 >
393    key <KP9>  { [  KP_Prior,   KP_9,  asciicircum ] }; //  <prior> 9 ^
394
395    key <KP4>  { [   KP_Left,   KP_4,  bracketleft ] }; //   <left> 4 [
396    key <KP5>  { [  KP_Begin,   KP_5, bracketright ] }; //  <begin> 5 ]
397    key <KP6>  { [  KP_Right,   KP_6,       dollar ] }; //  <right> 6 $
398
399    key <KP1>  { [    KP_End,   KP_1,    ampersand ] }; //    <end> 1 &
400    key <KP2>  { [   KP_Down,   KP_2,           at ] }; //   <down> 2 @
401    key <KP3>  { [   KP_Next,   KP_3,   numbersign ] }; //   <next> 3 #
402
403    key <KP0>  { [ KP_Insert,   KP_0,   apostrophe ] }; // <insert> 0 '
404};
405
406
407// Keypad number area with arrow symbols
408// Copyright © 2006 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
409//
410// ┏━━━━━┱
411// ┃Num  ┃                   ⇱ Home
412// ┃Lock⇭┃                   ⇲ End
413// ┡━━━━━╃─────┼─────┼       ⇞ Page up
414// │ 7 ⇖ │ 8 ⇑ │ 9 ⇗ │       ⇟ Page down
415// │ ⇱ ↖ │ ⇧ ↑ │ ⇞ ↗ │       ⎀ Insert
416// ├─────┼─────┼─────┤       ␥ Delete
417// │ 4 ⇐ │ 5 ⇔ │ 6 ⇒ │       ⇦⇧⇨⇩ Directions
418// │ ⇦ ← │   ↔ │ ⇨ → │       ⍽ narrow no-break space
419// ├─────┼─────┼─────╆
420// │ 1 ⇙ │ 2 ⇓ │ 3 ⇘ ┃
421// │ ⇲ ↙ │ ⇩ ↓ │ ⇟ ↘ ┃       1 None
422// ├─────┴─────┼─────┨       2 Num Lock ⇭
423// │ 0       ⇕ │             3 Level3 ⇮
424// │ ⎀       ↕ │             4 Shift+Level3 ⇧⇮
425// └───────────┴
426partial keypad_keys
427xkb_symbols "ossnumber" {
428
429    key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
430
431    key <KP7>  { [   KP_Home,   KP_7, 0x1002196, 0x10021D6 ] }; //   <home> 7 ↖ ⇖
432    key <KP8>  { [     KP_Up,   KP_8, 0x1002191, 0x10021D1 ] }; //     <up> 8 ↑ ⇑
433    key <KP9>  { [  KP_Prior,   KP_9, 0x1002197, 0x10021D7 ] }; //  <prior> 9 ↗ ⇗
434
435    key <KP4>  { [   KP_Left,   KP_4, 0x1002190, 0x10021D0 ] }; //   <left> 4 ← ⇐
436    key <KP5>  { [  KP_Begin,   KP_5, 0x1002194, 0x10021D4 ] }; //  <begin> 5 ↔ ⇔
437    key <KP6>  { [  KP_Right,   KP_6, 0x1002192, 0x10021D2 ] }; //  <right> 6 → ⇒
438
439    key <KP1>  { [    KP_End,   KP_1, 0x1002199, 0x10021D9 ] }; //    <end> 1 ↙ ⇙
440    key <KP2>  { [   KP_Down,   KP_2, 0x1002193, 0x10021D3 ] }; //   <down> 2 ↓ ⇓
441    key <KP3>  { [   KP_Next,   KP_3, 0x1002198, 0x10021D8 ] }; //   <next> 3 ↘ ⇘
442
443    key <KP0>  { [ KP_Insert,   KP_0, 0x1002195, 0x10021D5 ] }; // <insert> 0 ↕ ⇕
444};
445
446
447// Wang 725-3771-ae and 725-3771-uk keypad number area with additional arrow symbols
448// Copyright © 2007 Nicolas Mailhot <nicolas.mailhot @ laposte.net>
449//
450// ┏━━━━━┱
451// ┃Num  ┃                   ⇱ Home
452// ┃Lock⇭┃                   ⇲ End
453// ┡━━━━━╃─────┼─────┼       ⇞ Page up
454// │ 7 ↖ │ 8 ↑ │ 9 ↗ │       ⇟ Page down
455// │ ⇱ < │ ⇧ > │ ⇞ ^ │       ⎀ Insert
456// ├─────┼─────┼─────┤       ␥ Delete
457// │ 4 ← │ 5 ↔ │ 6 → │       ⇦⇧⇨⇩ Directions
458// │ ⇦ [ │   ] │ ⇨ $ │       ⍽ narrow no-break space
459// ├─────┼─────┼─────╆
460// │ 1 ↙ │ 2 ↓ │ 3 ↘ ┃
461// │ ⇲ & │ ⇩ @ │ ⇟ # ┃       1 None
462// ├─────┴─────┼─────┨       2 Num Lock ⇭
463// │ 0       ↕ │             3 Level3 ⇮
464// │ ⎀       ' │             4 Shift+Level3 ⇧⇮
465// └───────────┴
466partial keypad_keys
467xkb_symbols "ossnumber_wang" {
468
469    key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
470
471    key <KP7>  { [   KP_Home,   KP_7,         less, 0x1002196 ] }; //   <home> 7 < ↖
472    key <KP8>  { [     KP_Up,   KP_8,      greater, 0x1002191 ] }; //     <up> 8 > ↑
473    key <KP9>  { [  KP_Prior,   KP_9,  asciicircum, 0x1002197 ] }; //  <prior> 9 ^ ↗
474
475    key <KP4>  { [   KP_Left,   KP_4,  bracketleft, 0x1002190 ] }; //   <left> 4 [ ←
476    key <KP5>  { [  KP_Begin,   KP_5, bracketright, 0x1002194 ] }; //  <begin> 5 ] ↔
477    key <KP6>  { [  KP_Right,   KP_6,       dollar, 0x1002192 ] }; //  <right> 6 $ →
478
479    key <KP1>  { [    KP_End,   KP_1,    ampersand, 0x1002199 ] }; //    <end> 1 & ↙
480    key <KP2>  { [   KP_Down,   KP_2,           at, 0x1002193 ] }; //   <down> 2 @ ↓
481    key <KP3>  { [   KP_Next,   KP_3,   numbersign, 0x1002198 ] }; //   <next> 3 # ↘
482
483    key <KP0>  { [ KP_Insert,   KP_0,   apostrophe, 0x1002195 ] }; // <insert> 0 ' ↕
484};
485
486// Standard base "pc" layout only contains cursor keys, and then gets
487// augmented with the digits later. If you define your own layout for
488// the numpad you can inherit the cursors, but you'll have to define
489// the digits yourself. This module can be included in the rules to
490// define math operators; these are the variants used in computer
491// languages that are based on ASCII. NoSymbol doesn't mean that
492// nothing is bound to the key but that no assignment is done here.
493// srvr_ctrl(stdkeypad) and keypad(x11) declare the operator keys to
494// be of type CTRL+ALT in order to assign server control events to
495// them, but it uses the second level which is overwritten if we have
496// more than one definition (shift state) for the key. Instead, here
497// the commands are put at the fourth level.
498partial keypad_keys
499xkb_symbols "ops" {
500    key <KPDV> { [ NoSymbol,  slash,     NoSymbol,  XF86_Ungrab     ] };
501    key <KPMU> { [ NoSymbol,  asterisk,  NoSymbol,  XF86_ClearGrab  ] };
502    key <KPSU> { [ NoSymbol,  minus,     NoSymbol,  XF86_Prev_VMode ] };
503    key <KPAD> { [ NoSymbol,  plus,      NoSymbol,  XF86_Next_VMode ] };
504    key <KPEQ> { [ NoSymbol,  equal      ] };
505};
506
507// Hexadecimal Numpad, by Roland Kaufmann <rlndkfmn at gmail dot com>
508// License: BSD (also covers variant with ATM digit order)
509// Third-level gives the letters used in hexadecimal numbers, or
510// columns in small spreadsheets. As a bonus, having 'e' available at
511// the center of the keyboard makes it easy to enter floating point
512// numbers in scientific notation.
513// Equal is added to start formulas (most numpads on PCs don't have
514// their own equal key), comma as a list separator (as most
515// programming languages wants period as a decimal separator) and
516// colon to enter times and ranges. Someone also may want to represent
517// multiplication and division in prose using x and colon.
518// Two first levels are specified as NoSymbol to not override any
519// previous specification. Combine this with another keypad specifier,
520// e.g. "legacy".
521partial keypad_keys
522xkb_symbols "hex" {
523    key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ;
524
525    //             None       NumLock    AltGr
526    // symbol row
527    key <KPDV> { [ NoSymbol,  NoSymbol,  parenleft  ] };
528    key <KPMU> { [ NoSymbol,  NoSymbol,  parenright ] };
529    key <KPSU> { [ NoSymbol,  NoSymbol,  dollar     ] };
530
531    // upper row
532    key <KP7>  { [ NoSymbol,  NoSymbol,  a          ] };
533    key <KP8>  { [ NoSymbol,  NoSymbol,  b          ] };
534    key <KP9>  { [ NoSymbol,  NoSymbol,  c          ] };
535
536    // home row
537    key <KP4>  { [ NoSymbol,  NoSymbol,  d          ] };
538    key <KP5>  { [ NoSymbol,  NoSymbol,  e          ] };
539    key <KP6>  { [ NoSymbol,  NoSymbol,  f          ] };
540    key <KPAD> { [ NoSymbol,  NoSymbol,  comma      ] };
541
542    // lower row
543    key <KP1>  { [ NoSymbol,  NoSymbol,  equal      ] };
544    key <KP2>  { [ NoSymbol,  NoSymbol,  x          ] };
545    key <KP3>  { [ NoSymbol,  NoSymbol,  colon      ] };
546
547    // decimal row
548    key <KP0>  { [ NoSymbol,  NoSymbol,  backslash  ] };
549};
550
551// Main numbers follows the traditions from ATMs and phones with
552// numbers increasing downwards to the right. (It is easier to
553// change the keyboard layout than to reprogram your local ATM;
554// also cell-phones are becoming more common while calculators are
555// becoming more rare).
556// First level is left unspecified, so it may be combined with another
557// layout, e.g. "legacy".
558partial keypad_keys
559xkb_symbols "atm" {
560    // upper row
561    key <KP7>  { [ NoSymbol,  KP_1 ] };
562    key <KP8>  { [ NoSymbol,  KP_2 ] };
563    key <KP9>  { [ NoSymbol,  KP_3 ] };
564
565    // lower row
566    key <KP1>  { [ NoSymbol,  KP_7 ] };
567    key <KP2>  { [ NoSymbol,  KP_8 ] };
568    key <KP3>  { [ NoSymbol,  KP_9 ] };
569};
570
571
572partial modifier_keys
573xkb_symbols "pointerkeys" {
574    key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
575};
576
577
578// Only numbers, operators and decimal separator,
579// as seen on keypad overlay on Japanese keyboard.
580// ┌─┬─┬─┬─┐
581// │7│8│9│*│
582// ├─┼─┼─┼─┤
583// │4│5│6│-│
584// ├─┼─┼─┼─┤
585// │1│2│3│+│
586// ├─┼─┼─┼─┤
587// │0│ │·│/│
588// └─┴─┴─┴─┘
589partial keypad_keys
590xkb_symbols "numoperdecsep" {
591    key  <KO7> {	[  KP_7	]	};
592    key  <KO8> {	[  KP_8	]	};
593    key  <KO9> {	[  KP_9	]	};
594// ClsGrb kills whichever client has a grab in effect
595    key <KOMU> {
596        type="CTRL+ALT",
597        symbols[Group1]= [ KP_Multiply, KP_Multiply, KP_Multiply, KP_Multiply, XF86_ClearGrab ]
598    };
599
600    key  <KO4> {	[  KP_4	]	};
601    key  <KO5> {	[  KP_5	]	};
602    key  <KO6> {	[  KP_6	]	};
603// -VMode switches to the previous video mode
604    key <KOSU> {
605        type="CTRL+ALT",
606        symbols[Group1]= [ KP_Subtract, KP_Subtract, KP_Subtract, KP_Subtract, XF86_Prev_VMode ]
607    };
608
609    key  <KO1> {	[  KP_1	]	};
610    key  <KO2> {	[  KP_2	]	};
611    key  <KO3> {	[  KP_3	]	};
612// +VMode switches to the next video mode
613    key <KOAD> {
614        type="CTRL+ALT",
615        symbols[Group1]= [ KP_Add, KP_Add, KP_Add, KP_Add, XF86_Next_VMode ]
616    };
617
618    key  <KO0> {	[  KP_0	]	};
619    key <KODL> {	[ KP_Decimal ]	};
620// Ungrab cancels server/keyboard/pointer grabs
621    key <KODV> {
622        type="CTRL+ALT",
623        symbols[Group1]= [ KP_Divide, KP_Divide, KP_Divide, KP_Divide, XF86_Ungrab ]
624    };
625};
626