2 * Copyright © 2012 Ran Benita <ran234@gmail.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 #include <linux/input.h>
37 #define EVDEV_OFFSET 8
40 * Test a sequence of keysyms, resulting from a sequence of key presses,
41 * against the keysyms they're supposed to generate.
43 * - Each test runs with a clean state.
44 * - Each line in the test is made up of:
45 * + A keycode, given as a KEY_* from linux/input.h.
46 * + A direction - DOWN for press, UP for release, BOTH for
47 * immediate press + release, REPEAT to just get the syms.
48 * + A sequence of keysyms that should result from this keypress.
50 * The vararg format is:
51 * <KEY_*> <DOWN | UP | BOTH> <XKB_KEY_* (zero or more)> <NEXT | FINISH>
53 * See below for examples.
56 test_key_seq(struct xkb_keymap *keymap, ...)
58 struct xkb_state *state;
65 const xkb_keysym_t *syms;
66 unsigned int nsyms, i;
69 fprintf(stderr, "----\n");
71 state = xkb_state_new(keymap);
77 kc = va_arg(ap, int) + EVDEV_OFFSET;
80 nsyms = xkb_state_key_get_syms(state, kc, &syms);
81 fprintf(stderr, "got %d syms for key 0x%x: [", nsyms, kc);
83 if (op == DOWN || op == BOTH)
84 xkb_state_update_key(state, kc, XKB_KEY_DOWN);
85 if (op == UP || op == BOTH)
86 xkb_state_update_key(state, kc, XKB_KEY_UP);
88 for (i = 0; i < nsyms; i++) {
89 keysym = va_arg(ap, int);
90 xkb_keysym_get_name(syms[i], ksbuf, sizeof(ksbuf));
91 fprintf(stderr, "%s%s", (i != 0) ? ", " : "", ksbuf);
93 if (keysym == FINISH || keysym == NEXT) {
94 xkb_keysym_get_name(syms[i], ksbuf, sizeof(ksbuf));
95 fprintf(stderr, "Did not expect keysym: %s.\n", ksbuf);
99 if (keysym != syms[i]) {
100 xkb_keysym_get_name(keysym, ksbuf, sizeof(ksbuf));
101 fprintf(stderr, "Expected keysym: %s. ", ksbuf);;
102 xkb_keysym_get_name(syms[i], ksbuf, sizeof(ksbuf));
103 fprintf(stderr, "Got keysym: %s.\n", ksbuf);;
108 fprintf(stderr, "]\n");
110 keysym = va_arg(ap, int);
113 if (keysym == FINISH)
116 xkb_keysym_get_name(keysym, ksbuf, sizeof(ksbuf));
117 fprintf(stderr, "Expected keysym: %s. Didn't get it.\n", ksbuf);
122 xkb_state_unref(state);
127 xkb_state_unref(state);
134 struct xkb_context *ctx = test_get_context();
135 struct xkb_keymap *keymap;
138 keymap = test_compile_rules(ctx, "evdev", "evdev",
139 "us,il,ru,de", ",,phonetic,neo",
140 "grp:alt_shift_toggle,grp:menu_toggle");
143 assert(test_key_seq(keymap,
144 KEY_H, BOTH, XKB_KEY_h, NEXT,
145 KEY_E, BOTH, XKB_KEY_e, NEXT,
146 KEY_L, BOTH, XKB_KEY_l, NEXT,
147 KEY_L, BOTH, XKB_KEY_l, NEXT,
148 KEY_O, BOTH, XKB_KEY_o, FINISH));
150 /* Simple shifted level. */
151 assert(test_key_seq(keymap,
152 KEY_H, BOTH, XKB_KEY_h, NEXT,
153 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
154 KEY_E, BOTH, XKB_KEY_E, NEXT,
155 KEY_L, BOTH, XKB_KEY_L, NEXT,
156 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
157 KEY_L, BOTH, XKB_KEY_l, NEXT,
158 KEY_O, BOTH, XKB_KEY_o, FINISH));
160 /* Key repeat shifted and unshifted in the middle. */
161 assert(test_key_seq(keymap,
162 KEY_H, DOWN, XKB_KEY_h, NEXT,
163 KEY_H, REPEAT, XKB_KEY_h, NEXT,
164 KEY_H, REPEAT, XKB_KEY_h, NEXT,
165 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
166 KEY_H, REPEAT, XKB_KEY_H, NEXT,
167 KEY_H, REPEAT, XKB_KEY_H, NEXT,
168 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
169 KEY_H, REPEAT, XKB_KEY_h, NEXT,
170 KEY_H, REPEAT, XKB_KEY_h, NEXT,
171 KEY_H, UP, XKB_KEY_h, NEXT,
172 KEY_H, BOTH, XKB_KEY_h, FINISH));
174 /* Base modifier cleared on key release... */
175 assert(test_key_seq(keymap,
176 KEY_H, BOTH, XKB_KEY_h, NEXT,
177 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
178 KEY_E, BOTH, XKB_KEY_E, NEXT,
179 KEY_L, BOTH, XKB_KEY_L, NEXT,
180 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
181 KEY_L, BOTH, XKB_KEY_L, NEXT,
182 KEY_O, BOTH, XKB_KEY_O, FINISH));
184 /* ... But only by the keycode that set it. */
185 assert(test_key_seq(keymap,
186 KEY_H, BOTH, XKB_KEY_h, NEXT,
187 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
188 KEY_E, BOTH, XKB_KEY_E, NEXT,
189 KEY_L, BOTH, XKB_KEY_L, NEXT,
190 KEY_RIGHTSHIFT, UP, XKB_KEY_Shift_R, NEXT,
191 KEY_L, BOTH, XKB_KEY_L, NEXT,
192 KEY_O, BOTH, XKB_KEY_O, FINISH));
195 * A base modifier should only be cleared when no other key affecting
196 * the modifier is down.
198 assert(test_key_seq(keymap,
199 KEY_H, BOTH, XKB_KEY_h, NEXT,
200 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
201 KEY_E, BOTH, XKB_KEY_E, NEXT,
202 KEY_RIGHTSHIFT, DOWN, XKB_KEY_Shift_R, NEXT,
203 KEY_L, BOTH, XKB_KEY_L, NEXT,
204 KEY_RIGHTSHIFT, UP, XKB_KEY_Shift_R, NEXT,
205 KEY_L, BOTH, XKB_KEY_L, NEXT,
206 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
207 KEY_O, BOTH, XKB_KEY_o, FINISH));
209 /* Group switching / locking. */
210 assert(test_key_seq(keymap,
211 KEY_H, BOTH, XKB_KEY_h, NEXT,
212 KEY_E, BOTH, XKB_KEY_e, NEXT,
213 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
214 KEY_K, BOTH, XKB_KEY_hebrew_lamed, NEXT,
215 KEY_F, BOTH, XKB_KEY_hebrew_kaph, NEXT,
216 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
217 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
218 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
219 KEY_O, BOTH, XKB_KEY_o, FINISH));
221 assert(test_key_seq(keymap,
222 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
223 KEY_LEFTALT, DOWN, XKB_KEY_ISO_Next_Group, NEXT,
224 KEY_LEFTALT, UP, XKB_KEY_ISO_Next_Group, NEXT,
225 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, FINISH));
227 assert(test_key_seq(keymap,
228 KEY_LEFTALT, DOWN, XKB_KEY_Alt_L, NEXT,
229 KEY_LEFTSHIFT, DOWN, XKB_KEY_ISO_Next_Group, NEXT,
230 KEY_LEFTSHIFT, UP, XKB_KEY_ISO_Next_Group, NEXT,
231 KEY_LEFTALT, UP, XKB_KEY_Alt_L, FINISH));
233 /* Locked modifiers. */
234 assert(test_key_seq(keymap,
235 KEY_CAPSLOCK, BOTH, XKB_KEY_Caps_Lock, NEXT,
236 KEY_H, BOTH, XKB_KEY_H, NEXT,
237 KEY_E, BOTH, XKB_KEY_E, NEXT,
238 KEY_L, BOTH, XKB_KEY_L, NEXT,
239 KEY_L, BOTH, XKB_KEY_L, NEXT,
240 KEY_O, BOTH, XKB_KEY_O, FINISH));
242 assert(test_key_seq(keymap,
243 KEY_H, BOTH, XKB_KEY_h, NEXT,
244 KEY_E, BOTH, XKB_KEY_e, NEXT,
245 KEY_CAPSLOCK, BOTH, XKB_KEY_Caps_Lock, NEXT,
246 KEY_L, BOTH, XKB_KEY_L, NEXT,
247 KEY_L, BOTH, XKB_KEY_L, NEXT,
248 KEY_CAPSLOCK, BOTH, XKB_KEY_Caps_Lock, NEXT,
249 KEY_O, BOTH, XKB_KEY_o, FINISH));
251 assert(test_key_seq(keymap,
252 KEY_H, BOTH, XKB_KEY_h, NEXT,
253 KEY_CAPSLOCK, DOWN, XKB_KEY_Caps_Lock, NEXT,
254 KEY_E, BOTH, XKB_KEY_E, NEXT,
255 KEY_L, BOTH, XKB_KEY_L, NEXT,
256 KEY_L, BOTH, XKB_KEY_L, NEXT,
257 KEY_CAPSLOCK, UP, XKB_KEY_Caps_Lock, NEXT,
258 KEY_O, BOTH, XKB_KEY_O, FINISH));
260 assert(test_key_seq(keymap,
261 KEY_H, BOTH, XKB_KEY_h, NEXT,
262 KEY_E, BOTH, XKB_KEY_e, NEXT,
263 KEY_CAPSLOCK, UP, XKB_KEY_Caps_Lock, NEXT,
264 KEY_L, BOTH, XKB_KEY_l, NEXT,
265 KEY_L, BOTH, XKB_KEY_l, NEXT,
266 KEY_O, BOTH, XKB_KEY_o, FINISH));
269 * A key release affecting a locked modifier should clear it
270 * regardless of the key press.
272 /* assert(test_key_seq(keymap, */
273 /* KEY_H, BOTH, XKB_KEY_h, NEXT, */
274 /* KEY_CAPSLOCK, DOWN, XKB_KEY_Caps_Lock, NEXT, */
275 /* KEY_E, BOTH, XKB_KEY_E, NEXT, */
276 /* KEY_L, BOTH, XKB_KEY_L, NEXT, */
277 /* KEY_CAPSLOCK, UP, XKB_KEY_Caps_Lock, NEXT, */
278 /* KEY_L, BOTH, XKB_KEY_L, NEXT, */
279 /* KEY_CAPSLOCK, UP, XKB_KEY_Caps_Lock, NEXT, */
280 /* KEY_O, BOTH, XKB_KEY_o, FINISH)); */
282 /* Simple Num Lock sanity check. */
283 assert(test_key_seq(keymap,
284 KEY_KP1, BOTH, XKB_KEY_KP_End, NEXT,
285 KEY_NUMLOCK, BOTH, XKB_KEY_Num_Lock, NEXT,
286 KEY_KP1, BOTH, XKB_KEY_KP_1, NEXT,
287 KEY_KP2, BOTH, XKB_KEY_KP_2, NEXT,
288 KEY_NUMLOCK, BOTH, XKB_KEY_Num_Lock, NEXT,
289 KEY_KP2, BOTH, XKB_KEY_KP_Down, FINISH));
291 /* Test that the aliases in the ru(phonetic) symbols map work. */
292 assert(test_key_seq(keymap,
293 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
294 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
295 KEY_1, BOTH, XKB_KEY_1, NEXT,
296 KEY_Q, BOTH, XKB_KEY_Cyrillic_ya, NEXT,
297 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
298 KEY_1, BOTH, XKB_KEY_exclam, NEXT,
299 KEY_Q, BOTH, XKB_KEY_Cyrillic_YA, NEXT,
300 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
301 KEY_V, BOTH, XKB_KEY_Cyrillic_zhe, NEXT,
302 KEY_CAPSLOCK, BOTH, XKB_KEY_Caps_Lock, NEXT,
303 KEY_1, BOTH, XKB_KEY_1, NEXT,
304 KEY_V, BOTH, XKB_KEY_Cyrillic_ZHE, NEXT,
305 KEY_RIGHTSHIFT, DOWN, XKB_KEY_Shift_R, NEXT,
306 KEY_V, BOTH, XKB_KEY_Cyrillic_zhe, NEXT,
307 KEY_RIGHTSHIFT, UP, XKB_KEY_Shift_R, NEXT,
308 KEY_V, BOTH, XKB_KEY_Cyrillic_ZHE, FINISH));
310 #define KS(name) xkb_keysym_from_name(name, 0)
312 /* Test that levels (1-5) in de(neo) symbols map work. */
313 assert(test_key_seq(keymap,
314 /* Switch to the group. */
315 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
316 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
317 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
320 KEY_1, BOTH, XKB_KEY_1, NEXT,
321 KEY_Q, BOTH, XKB_KEY_x, NEXT,
322 KEY_KP7, BOTH, XKB_KEY_KP_7, NEXT,
323 KEY_ESC, BOTH, XKB_KEY_Escape, NEXT,
325 /* Level 2 with Shift. */
326 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
327 KEY_1, BOTH, XKB_KEY_degree, NEXT,
328 KEY_Q, BOTH, XKB_KEY_X, NEXT,
329 KEY_KP7, BOTH, KS("U2714"), NEXT,
330 KEY_ESC, BOTH, XKB_KEY_Escape, NEXT,
332 * XXX: de(neo) uses shift(both_capslock) which causes
333 * the interesting result in the next line. Since it's
334 * a key release, it doesn't actually lock the modifier,
335 * and applications by-and-large ignore the keysym on
336 * release(?). Is this a problem?
338 KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT,
340 /* Level 2 with the Lock modifier. */
341 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
342 KEY_RIGHTSHIFT, BOTH, XKB_KEY_Caps_Lock, NEXT,
343 KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT,
344 KEY_6, BOTH, XKB_KEY_6, NEXT,
345 KEY_H, BOTH, XKB_KEY_S, NEXT,
346 KEY_KP3, BOTH, XKB_KEY_KP_3, NEXT,
347 KEY_ESC, BOTH, XKB_KEY_Escape, NEXT,
348 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
349 KEY_RIGHTSHIFT, BOTH, XKB_KEY_Caps_Lock, NEXT,
350 KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT,
353 KEY_CAPSLOCK, DOWN, XKB_KEY_ISO_Level3_Shift, NEXT,
354 KEY_6, BOTH, XKB_KEY_cent, NEXT,
355 KEY_Q, BOTH, XKB_KEY_ellipsis, NEXT,
356 KEY_KP7, BOTH, KS("U2195"), NEXT,
357 KEY_ESC, BOTH, XKB_KEY_Escape, NEXT,
358 KEY_CAPSLOCK, UP, XKB_KEY_ISO_Level3_Shift, NEXT,
361 KEY_CAPSLOCK, DOWN, XKB_KEY_ISO_Level3_Shift, NEXT,
362 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
363 KEY_5, BOTH, XKB_KEY_malesymbol, NEXT,
364 KEY_E, BOTH, XKB_KEY_Greek_lambda, NEXT,
365 KEY_SPACE, BOTH, XKB_KEY_nobreakspace, NEXT,
366 KEY_KP8, BOTH, XKB_KEY_intersection, NEXT,
367 KEY_ESC, BOTH, XKB_KEY_Escape, NEXT,
368 KEY_LEFTSHIFT, UP, XKB_KEY_Caps_Lock, NEXT,
369 KEY_CAPSLOCK, UP, XKB_KEY_ISO_Level3_Shift, NEXT,
372 KEY_RIGHTALT, DOWN, XKB_KEY_ISO_Level5_Shift, NEXT,
373 KEY_5, BOTH, XKB_KEY_periodcentered, NEXT,
374 KEY_E, BOTH, XKB_KEY_Up, NEXT,
375 KEY_SPACE, BOTH, XKB_KEY_KP_0, NEXT,
376 KEY_KP8, BOTH, XKB_KEY_KP_Up, NEXT,
377 KEY_ESC, BOTH, XKB_KEY_Escape, NEXT,
378 KEY_RIGHTALT, UP, XKB_KEY_ISO_Level5_Shift, NEXT,
380 KEY_V, BOTH, XKB_KEY_p, FINISH));
382 xkb_keymap_unref(keymap);
384 keymap = test_compile_rules(ctx, "evdev", "", "us,il,ru", "",
385 "grp:alt_shift_toggle_bidir,grp:menu_toggle");
388 assert(test_key_seq(keymap,
389 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
390 KEY_LEFTALT, DOWN, XKB_KEY_ISO_Prev_Group, NEXT,
391 KEY_LEFTALT, UP, XKB_KEY_ISO_Prev_Group, NEXT,
392 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, FINISH));
394 assert(test_key_seq(keymap,
395 KEY_LEFTALT, DOWN, XKB_KEY_Alt_L, NEXT,
396 KEY_LEFTSHIFT, DOWN, XKB_KEY_ISO_Prev_Group, NEXT,
397 KEY_LEFTSHIFT, UP, XKB_KEY_ISO_Prev_Group, NEXT,
398 KEY_LEFTALT, UP, XKB_KEY_Alt_L, FINISH));
400 /* Check backwards (negative) group switching and wrapping. */
401 assert(test_key_seq(keymap,
402 KEY_H, BOTH, XKB_KEY_h, NEXT,
403 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
404 KEY_H, BOTH, XKB_KEY_hebrew_yod, NEXT,
405 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
406 KEY_H, BOTH, XKB_KEY_Cyrillic_er, NEXT,
407 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
408 KEY_LEFTALT, BOTH, XKB_KEY_ISO_Prev_Group, NEXT,
409 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
410 KEY_H, BOTH, XKB_KEY_hebrew_yod, NEXT,
411 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
412 KEY_LEFTALT, BOTH, XKB_KEY_ISO_Prev_Group, NEXT,
413 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
414 KEY_H, BOTH, XKB_KEY_h, NEXT,
415 KEY_LEFTSHIFT, DOWN, XKB_KEY_Shift_L, NEXT,
416 KEY_LEFTALT, BOTH, XKB_KEY_ISO_Prev_Group, NEXT,
417 KEY_LEFTSHIFT, UP, XKB_KEY_Shift_L, NEXT,
418 KEY_H, BOTH, XKB_KEY_Cyrillic_er, NEXT,
419 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
420 KEY_H, BOTH, XKB_KEY_h, FINISH));
422 xkb_keymap_unref(keymap);
424 keymap = test_compile_rules(ctx, "evdev", "", "us,il,ru", "",
425 "grp:switch,grp:lswitch,grp:menu_toggle");
428 /* Test depressed group works (Mode_switch). */
429 assert(test_key_seq(keymap,
430 KEY_H, BOTH, XKB_KEY_h, NEXT,
431 KEY_RIGHTALT, DOWN, XKB_KEY_Mode_switch, NEXT,
432 KEY_H, BOTH, XKB_KEY_hebrew_yod, NEXT,
433 KEY_RIGHTALT, UP, XKB_KEY_ISO_Level3_Shift, NEXT,
434 KEY_H, BOTH, XKB_KEY_h, NEXT,
435 KEY_RIGHTALT, DOWN, XKB_KEY_Mode_switch, NEXT,
436 KEY_H, BOTH, XKB_KEY_hebrew_yod, NEXT,
437 KEY_RIGHTALT, UP, XKB_KEY_ISO_Level3_Shift, NEXT,
438 KEY_H, BOTH, XKB_KEY_h, FINISH));
440 /* Test locked+depressed group works, with wrapping and accumulation. */
441 assert(test_key_seq(keymap,
442 KEY_H, BOTH, XKB_KEY_h, NEXT,
443 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
444 KEY_LEFTALT, DOWN, XKB_KEY_Mode_switch, NEXT,
445 KEY_H, BOTH, XKB_KEY_Cyrillic_er, NEXT,
446 KEY_LEFTALT, UP, XKB_KEY_Mode_switch, NEXT,
447 KEY_H, BOTH, XKB_KEY_hebrew_yod, NEXT,
448 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
449 KEY_LEFTALT, DOWN, XKB_KEY_Mode_switch, NEXT,
450 /* Should wrap back to first group. */
451 KEY_H, BOTH, XKB_KEY_h, NEXT,
452 KEY_LEFTALT, UP, XKB_KEY_Mode_switch, NEXT,
453 KEY_H, BOTH, XKB_KEY_Cyrillic_er, NEXT,
454 KEY_COMPOSE, BOTH, XKB_KEY_ISO_Next_Group, NEXT,
455 KEY_H, BOTH, XKB_KEY_h, NEXT,
456 /* Two SetGroup(+1)'s should add up. */
457 KEY_RIGHTALT, DOWN, XKB_KEY_Mode_switch, NEXT,
458 KEY_H, BOTH, XKB_KEY_hebrew_yod, NEXT,
459 KEY_LEFTALT, DOWN, XKB_KEY_Mode_switch, NEXT,
460 KEY_H, BOTH, XKB_KEY_Cyrillic_er, NEXT,
461 KEY_LEFTALT, UP, XKB_KEY_Mode_switch, NEXT,
462 KEY_H, BOTH, XKB_KEY_hebrew_yod, NEXT,
463 KEY_RIGHTALT, UP, XKB_KEY_ISO_Level3_Shift, NEXT,
464 KEY_H, BOTH, XKB_KEY_h, FINISH));
466 xkb_keymap_unref(keymap);
467 xkb_context_unref(ctx);