xkb_keymap_num_layouts_for_key(struct xkb_keymap *keymap, xkb_keycode_t kc)
{
const struct xkb_key *key = XkbKey(keymap, kc);
+
if (!key)
return 0;
xkb_layout_index_t layout)
{
const struct xkb_key *key = XkbKey(keymap, kc);
+
if (!key)
return 0;
const struct xkb_key *key = XkbKey(keymap, kc);
int num_syms;
+ if (!key)
+ goto err;
if (layout >= key->num_groups)
goto err;
if (level >= XkbKeyGroupWidth(keymap, key, layout))
xkb_keymap_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t kc)
{
const struct xkb_key *key = XkbKey(keymap, kc);
+
if (!key)
return 0;
XKB_EXPORT xkb_layout_index_t
xkb_state_key_get_layout(struct xkb_state *state, xkb_keycode_t kc)
{
- const struct xkb_key *key = XkbKey(state->keymap, kc);
xkb_layout_index_t ret =
xkb_state_serialize_layout(state, XKB_STATE_EFFECTIVE);
+ const struct xkb_key *key = XkbKey(state->keymap, kc);
- if (key->num_groups == 0)
+ if (!key || key->num_groups == 0)
return XKB_LAYOUT_INVALID;
if (ret < key->num_groups)
xkb_mod_index_t i;
xkb_mod_mask_t bit;
const struct xkb_key *key = XkbKey(state->keymap, kc);
+
if (!key)
return;
xkb_layout_index_t layout;
xkb_level_index_t level;
const struct xkb_key *key = XkbKey(state->keymap, kc);
+
if (!key)
return -1;
xkb_mod_index_t idx)
{
const struct xkb_key *key = XkbKey(state->keymap, kc);
+
if (!key)
return 0;
xkb_mod_mask_t mask)
{
const struct xkb_key *key = XkbKey(state->keymap, kc);
+
if (!key)
return 0;