syncing translations
[xorg/xkeyboard-config] / types / numpad
1 partial default xkb_types "pc" {
2     type "KEYPAD" {
3         modifiers = Shift+NumLock;
4         map[None] = Level1;
5         map[Shift] = Level2;
6         map[NumLock] = Level2;
7         map[Shift+NumLock] = Level1;
8         level_name[Level1] = "Base";
9         level_name[Level2] = "Number";
10     };
11     include "extra(keypad)"
12 };
13
14 // On Mac keypads, level 1 and 2 are swapped
15 partial xkb_types "mac" {
16     type "KEYPAD" {
17         modifiers = Shift+NumLock;
18         map[None] = Level2;
19         map[Shift] = Level1;
20         map[NumLock] = Level1;
21         map[Shift+NumLock] = Level2;
22         level_name[Level2] = "Base";
23         level_name[Level1] = "Number";
24     };
25     include "extra(mac_keypad)"
26 };
27
28 partial xkb_types "microsoft" {
29     type "KEYPAD" {
30         modifiers = Shift+NumLock;
31         map[None] = Level1;
32         preserve[Shift] = Shift;
33         map[NumLock] = Level2;
34         level_name[Level1] = "Base";
35         level_name[Level2] = "Number";
36     };
37     include "extra(keypad)"
38 };
39
40 // Swiss-German style numeric keypad: Shift and NumLock operates as
41 // two independent modifiers; however, since we want shift state for
42 // the cursor keys, only three levels are used from the key mappings.
43 // Closest type is actually FOUR_LEVEL_X, but most numpad layouts uses
44 // FOUR_LEVEL_MIXED_KEYPAD so that's the one we are going to override.
45 partial xkb_types "shift3" {
46     type "FOUR_LEVEL_MIXED_KEYPAD" {
47         modifiers = Shift+NumLock+Control+Alt;
48
49         // NumLock Off => navigate using cursor keys
50         map[None] = Level1;
51
52         // NumLock Off + Shift pressed => select using cursor keys
53         preserve[Shift] = Shift;
54
55         // NumLock On => decimal digits
56         map[NumLock] = Level2;
57
58         // NumLock On + Shift pressed => auxiliary symbols,
59         // e.g. hexadecimal digits
60         map[Shift+NumLock] = Level3;
61
62         // Ctrl + Alt, regardless of NumLock and Shift => command keys
63         map[Control+Alt] = Level4;
64
65         // reverse map from levels to modifiers
66         level_name[Level1] = "Base";
67         level_name[Level2] = "NumLock";
68         level_name[Level3] = "Shift+NumLock";
69         level_name[Level4] = "Ctrl+Alt";
70     };
71 };