diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 6a32eedd2..5c2f8a1c3 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -350,7 +350,9 @@ add_keysym_keycodes_from_layout (int keysym, { xkb_level_index_t layout_level; - for (layout_level = 0; layout_level < layout->n_levels; layout_level++) + for (layout_level = 0; + layout_level < layout->n_levels && keycodes->len == 0; + layout_level++) { FindKeysymData search_data = (FindKeysymData) { .keycodes = keycodes,