summaryrefslogtreecommitdiff
path: root/test/state.c
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-06-22 15:27:05 +0100
committerDaniel Stone <daniel@fooishbar.org>2012-06-22 15:27:05 +0100
commit8e2c66e9ea2f0c1302b943fe63212614b1a46e60 (patch)
treefa0d8d47908cbd3ca901838c17759d70838ce97d /test/state.c
parentfe89d031548b815e57aaef462354e6c400287de5 (diff)
Add xkb_key_repeats
Does what it says on the box. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'test/state.c')
-rw-r--r--test/state.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/state.c b/test/state.c
index 2409a23..d32a1ea 100644
--- a/test/state.c
+++ b/test/state.c
@@ -227,6 +227,18 @@ test_serialisation(struct xkb_keymap *keymap)
xkb_state_unref(state);
}
+static void
+test_repeat(struct xkb_keymap *keymap)
+{
+ xkb_keycode_t key;
+ fprintf(stderr, "%s\n", xkb_map_get_as_string(keymap));
+ for (key = keymap->min_key_code; key < keymap->max_key_code; key++)
+ if (xkb_key_repeats(keymap, key))
+ fprintf(stderr, "%d repeats!\n", key);
+ assert(!xkb_key_repeats(keymap, KEY_LEFTSHIFT + 8));
+ assert(xkb_key_repeats(keymap, KEY_A + 8));
+}
+
int
main(void)
{
@@ -248,6 +260,7 @@ main(void)
test_update_key(keymap);
test_serialisation(keymap);
+ test_repeat(keymap);
xkb_map_unref(keymap);
xkb_context_unref(context);