diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-05-09 15:31:21 +0100 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2013-05-09 15:31:21 +0100 |
commit | b06de3072b46a5108878b8e00f934f01fdb6a0ff (patch) | |
tree | fc173b401d3b31731abdddc211e3540f00a58792 /src | |
parent | 17a956d80781846903c90b7bd4beaf8ac7aac40c (diff) |
Add keycode min/max and iteration API
Add three new pieces of API:
- xkb_keymap_min_keycode does what it says on the tin
- xkb_keymap_max_keycode likewise
- xkb_keymap_key_for_each calls the provided function once for every
valid key in the keymap
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/keymap.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/keymap.c b/src/keymap.c index 55000f4..8205bab 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -484,6 +484,28 @@ err: return 0; } +XKB_EXPORT xkb_keycode_t +xkb_keymap_min_keycode(struct xkb_keymap *keymap) +{ + return keymap->min_key_code; +} + +XKB_EXPORT xkb_keycode_t +xkb_keymap_max_keycode(struct xkb_keymap *keymap) +{ + return keymap->max_key_code; +} + +XKB_EXPORT void +xkb_keymap_key_for_each(struct xkb_keymap *keymap, xkb_keymap_key_iter_t iter, + void *data) +{ + struct xkb_key *key; + + xkb_foreach_key(key, keymap) + iter(keymap, key->keycode, data); +} + /** * Simple boolean specifying whether or not the key should repeat. */ |