test/interactive: use num_layouts_for_key() This is the more appropriate for a specific key (also considering the num_layouts() is a bit of a made-up value). Signed-off-by: Ran Benita <ran234@gmail.com>
diff --git a/test/interactive.c b/test/interactive.c
index 90b1df2..94b14a7 100644
--- a/test/interactive.c
+++ b/test/interactive.c
@@ -255,8 +255,9 @@ print_keycode(struct keyboard *kbd, xkb_keycode_t keycode)
printf("] ");
#endif
- printf("groups [ ");
- for (group = 0; group < xkb_keymap_num_layouts(keymap); group++) {
+ 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;