diff options
author | Daniel Stone <daniel@fooishbar.org> | 2012-09-27 23:27:49 +1000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2012-09-27 23:27:49 +1000 |
commit | 5aaf65b74e4c165707d6bb967ce9627a1a808568 (patch) | |
tree | eeb7ede5a9ee3021f7c2d5934b42afd2a76b8d39 /test | |
parent | 29a8b1ceaca1f4c3d175cb23d2fbc57a5e00ed2f (diff) |
Add xkb_state_key_get_one_sym
The trivial wrapper around xkb_state_key_get_syms that every user to
date has implemented.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/state.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/state.c b/test/state.c index cdb7583..3da4c99 100644 --- a/test/state.c +++ b/test/state.c @@ -96,6 +96,7 @@ test_update_key(struct xkb_keymap *keymap) { struct xkb_state *state = xkb_state_new(keymap); const xkb_keysym_t *syms; + xkb_keysym_t one_sym; int num_syms; assert(state); @@ -174,6 +175,20 @@ test_update_key(struct xkb_keymap *keymap) num_syms = xkb_state_key_get_syms(state, KEY_Q + EVDEV_OFFSET, &syms); assert(num_syms == 1 && syms[0] == XKB_KEY_q); + /* Multiple symbols */ + num_syms = xkb_state_key_get_syms(state, KEY_6 + EVDEV_OFFSET, &syms); + assert(num_syms == 5 && + syms[0] == XKB_KEY_H && syms[1] == XKB_KEY_E && + syms[2] == XKB_KEY_L && syms[3] == XKB_KEY_L && + syms[4] == XKB_KEY_O); + one_sym = xkb_state_key_get_one_sym(state, KEY_6 + EVDEV_OFFSET); + assert(one_sym == XKB_KEY_NoSymbol); + xkb_state_update_key(state, KEY_6 + EVDEV_OFFSET, XKB_KEY_DOWN); + xkb_state_update_key(state, KEY_6 + EVDEV_OFFSET, XKB_KEY_UP); + + one_sym = xkb_state_key_get_one_sym(state, KEY_5 + EVDEV_OFFSET); + assert(one_sym == XKB_KEY_5); + xkb_state_unref(state); } |