1797b363dSmrg// Interpretations for arrow keys and a bunch of
2797b363dSmrg// other common keysyms which make it possible to
3797b363dSmrg// bind "mouse" keys using xmodmap and activate or
4797b363dSmrg// deactivate them from the keyboard.
5154daed1Smrg
6154daed1Smrgdefault partial xkb_compatibility "mousekeys" {
7154daed1Smrg
8154daed1Smrg    // Keypad actions.
9797b363dSmrg
10154daed1Smrg    interpret.repeat= True;
11154daed1Smrg
12797b363dSmrg    interpret KP_1 {
13797b363dSmrg	action = MovePtr(x=-1,y= +1);
14154daed1Smrg    };
15797b363dSmrg    interpret KP_End {
16797b363dSmrg	action = MovePtr(x=-1,y= +1);
17154daed1Smrg    };
18154daed1Smrg
19797b363dSmrg    interpret KP_2 {
20797b363dSmrg	action = MovePtr(x=+0,y= +1);
21154daed1Smrg    };
22797b363dSmrg    interpret KP_Down {
23797b363dSmrg	action = MovePtr(x=+0,y= +1);
24154daed1Smrg    };
25154daed1Smrg
26797b363dSmrg    interpret KP_3 {
27797b363dSmrg	action = MovePtr(x=+1,y=+1);
28154daed1Smrg    };
29797b363dSmrg    interpret KP_Next {
30797b363dSmrg	action = MovePtr(x=+1,y=+1);
31154daed1Smrg    };
32154daed1Smrg
33797b363dSmrg    interpret KP_4 {
34797b363dSmrg	action = MovePtr(x=-1,y=+0);
35154daed1Smrg    };
36797b363dSmrg    interpret KP_Left {
37797b363dSmrg	action = MovePtr(x=-1,y=+0);
38154daed1Smrg    };
39154daed1Smrg
40797b363dSmrg    interpret KP_6 {
41797b363dSmrg	action = MovePtr(x=+1,y=+0);
42154daed1Smrg    };
43797b363dSmrg    interpret KP_Right {
44797b363dSmrg	action = MovePtr(x=+1,y=+0);
45154daed1Smrg    };
46154daed1Smrg
47797b363dSmrg    interpret KP_7 {
48797b363dSmrg	action = MovePtr(x=-1,y=-1);
49154daed1Smrg    };
50797b363dSmrg    interpret KP_Home {
51797b363dSmrg	action = MovePtr(x=-1,y=-1);
52154daed1Smrg    };
53154daed1Smrg
54797b363dSmrg    interpret KP_8 {
55797b363dSmrg	action = MovePtr(x=+0,y=-1);
56154daed1Smrg    };
57797b363dSmrg    interpret KP_Up {
58797b363dSmrg	action = MovePtr(x=+0,y=-1);
59154daed1Smrg    };
60154daed1Smrg
61797b363dSmrg    interpret KP_9 {
62797b363dSmrg	action = MovePtr(x=+1,y=-1);
63154daed1Smrg    };
64797b363dSmrg    interpret KP_Prior {
65797b363dSmrg	action = MovePtr(x=+1,y=-1);
66154daed1Smrg    };
67154daed1Smrg
68797b363dSmrg    interpret KP_5 {
69797b363dSmrg	action = PointerButton(button=default);
70154daed1Smrg    };
71797b363dSmrg    interpret KP_Begin {
72797b363dSmrg	action = PointerButton(button=default);
73154daed1Smrg    };
74154daed1Smrg
75797b363dSmrg    interpret KP_F2 {
76797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=1);
77154daed1Smrg    };
78797b363dSmrg    interpret KP_Divide {
79797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=1);
80154daed1Smrg    };
81154daed1Smrg
82797b363dSmrg    interpret KP_F3 {
83797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=2);
84154daed1Smrg    };
85797b363dSmrg    interpret KP_Multiply {
86797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=2);
87154daed1Smrg    };
88154daed1Smrg
89797b363dSmrg    interpret KP_F4 {
90797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=3);
91154daed1Smrg    };
92797b363dSmrg    interpret KP_Subtract {
93797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=3);
94154daed1Smrg    };
95154daed1Smrg
96797b363dSmrg    interpret KP_Separator {
97797b363dSmrg	action = PointerButton(button=default,count=2);
98154daed1Smrg    };
99797b363dSmrg    interpret KP_Add {
100154daed1Smrg	action = PointerButton(button=default,count=2);
101154daed1Smrg    };
102154daed1Smrg
103797b363dSmrg    interpret KP_0 {
104797b363dSmrg	action = LockPointerButton(button=default,affect=lock);
105154daed1Smrg    };
106797b363dSmrg    interpret KP_Insert {
107797b363dSmrg	action = LockPointerButton(button=default,affect=lock);
108154daed1Smrg    };
109154daed1Smrg
110797b363dSmrg    interpret KP_Decimal {
111797b363dSmrg	action = LockPointerButton(button=default,affect=unlock);
112154daed1Smrg    };
113797b363dSmrg    interpret KP_Delete {
114797b363dSmrg	action = LockPointerButton(button=default,affect=unlock);
115154daed1Smrg    };
116154daed1Smrg
117797b363dSmrg    // Additional mappings for Solaris keypad compatibility.
118797b363dSmrg
119154daed1Smrg    interpret F25 { // aka KP_Divide
120797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=1);
121154daed1Smrg    };
122154daed1Smrg    interpret F26 { // aka KP_Multiply
123797b363dSmrg	action = SetPtrDflt(affect=defaultButton,button=2);
124154daed1Smrg    };
125154daed1Smrg    interpret F27 { // aka KP_Home
126797b363dSmrg	action = MovePtr(x=-1,y=-1);
127154daed1Smrg    };
128154daed1Smrg    interpret F29 { // aka KP_Prior
129797b363dSmrg	action = MovePtr(x=+1,y=-1);
130154daed1Smrg    };
131154daed1Smrg    interpret F31 { // aka KP_Begin
132797b363dSmrg	action = PointerButton(button=default);
133154daed1Smrg    };
134154daed1Smrg    interpret F33 { // aka KP_End
135797b363dSmrg	action = MovePtr(x=-1,y= +1);
136154daed1Smrg    };
137154daed1Smrg    interpret F35 { // aka KP_Next
138797b363dSmrg	action = MovePtr(x=+1,y=+1);
139154daed1Smrg    };
140154daed1Smrg
141154daed1Smrg    interpret.repeat= False;
142154daed1Smrg
143797b363dSmrg    // New keysym actions.
144154daed1Smrg
145154daed1Smrg    interpret Pointer_Button_Dflt {
146154daed1Smrg	action= PointerButton(button=default);
147154daed1Smrg    };
148154daed1Smrg    interpret Pointer_Button1 {
149154daed1Smrg	action= PointerButton(button=1);
150154daed1Smrg    };
151154daed1Smrg    interpret Pointer_Button2 {
152154daed1Smrg	action= PointerButton(button=2);
153154daed1Smrg    };
154154daed1Smrg    interpret Pointer_Button3 {
155154daed1Smrg	action= PointerButton(button=3);
156154daed1Smrg    };
157154daed1Smrg    interpret Pointer_DblClick_Dflt {
158154daed1Smrg	action= PointerButton(button=default,count=2);
159154daed1Smrg    };
160154daed1Smrg    interpret Pointer_DblClick1 {
161154daed1Smrg	action= PointerButton(button=1,count=2);
162154daed1Smrg    };
163154daed1Smrg    interpret Pointer_DblClick2 {
164154daed1Smrg	action= PointerButton(button=2,count=2);
165154daed1Smrg    };
166154daed1Smrg    interpret Pointer_DblClick3 {
167154daed1Smrg	action= PointerButton(button=3,count=2);
168154daed1Smrg    };
169797b363dSmrg    interpret Pointer_Drag_Dflt {
170154daed1Smrg	action= LockPointerButton(button=default);
171154daed1Smrg    };
172154daed1Smrg    interpret Pointer_Drag1 {
173154daed1Smrg	action= LockPointerButton(button=1);
174154daed1Smrg    };
175154daed1Smrg    interpret Pointer_Drag2 {
176154daed1Smrg	action= LockPointerButton(button=2);
177154daed1Smrg    };
178154daed1Smrg    interpret Pointer_Drag3 {
179154daed1Smrg	action= LockPointerButton(button=3);
180154daed1Smrg    };
181154daed1Smrg
182154daed1Smrg    interpret Pointer_EnableKeys {
183154daed1Smrg	action= LockControls(controls=MouseKeys);
184154daed1Smrg    };
185154daed1Smrg    interpret Pointer_Accelerate {
186154daed1Smrg	action= LockControls(controls=MouseKeysAccel);
187154daed1Smrg    };
188154daed1Smrg    interpret Pointer_DfltBtnNext {
189154daed1Smrg	action= SetPtrDflt(affect=defaultButton,button= +1);
190154daed1Smrg    };
191154daed1Smrg    interpret Pointer_DfltBtnPrev {
192154daed1Smrg	action= SetPtrDflt(affect=defaultButton,button= -1);
193154daed1Smrg    };
194154daed1Smrg
195154daed1Smrg    // Allow an indicator for MouseKeys.
196154daed1Smrg    indicator "Mouse Keys" {
197154daed1Smrg	indicatorDrivesKeyboard;
198154daed1Smrg	controls= MouseKeys;
199154daed1Smrg    };
200154daed1Smrg};
201