diff options
author | Ran Benita <ran234@gmail.com> | 2013-02-17 14:32:36 +0200 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2013-03-18 22:20:01 +0000 |
commit | 0ad8bf573f043fd837241d8375d5be963d3c3c3e (patch) | |
tree | 04b85ba66cdedc17abc06e22418aee394042fc75 /test | |
parent | bc7b2ff2fbb5c2d472b1722d2658c461d7c6c09c (diff) |
test/interactive: also print the level
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/interactive.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/test/interactive.c b/test/interactive.c index 94b14a7..2d655c6 100644 --- a/test/interactive.c +++ b/test/interactive.c @@ -223,7 +223,7 @@ print_keycode(struct keyboard *kbd, xkb_keycode_t keycode) unsigned int nsyms; char s[16]; uint32_t unicode; - xkb_layout_index_t group; + xkb_layout_index_t layout; xkb_mod_index_t mod; xkb_led_index_t led; @@ -255,15 +255,12 @@ print_keycode(struct keyboard *kbd, xkb_keycode_t keycode) printf("] "); #endif - printf("group [ "); - for (group = 0; group < xkb_keymap_num_layouts_for_key(keymap, keycode); - group++) { - if (xkb_state_layout_index_is_active(state, group, - XKB_STATE_LAYOUT_EFFECTIVE) <= 0) - continue; - printf("%s (%d) ", xkb_keymap_layout_get_name(keymap, group), group); - } - printf("] "); + layout = xkb_state_key_get_layout(state, keycode); + printf("layout [ %s (%d) ] ", + xkb_keymap_layout_get_name(keymap, layout), layout); + + printf("level [ %d ] ", + xkb_state_key_get_level(state, keycode, layout)); printf("mods [ "); for (mod = 0; mod < xkb_keymap_num_mods(keymap); mod++) { |