Run source tree through uncrustify
[platform/upstream/libxkbcommon.git] / src / map.c
index d4c8f3d..a3dc648 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -253,9 +253,6 @@ xkb_key_get_level(struct xkb_state *state, xkb_keycode_t key,
     active_mods &= type->mods.mask;
 
     darray_foreach(entry, type->map) {
-        if (!entry->active)
-            continue;
-
         if (entry->mods.mask == active_mods)
             return entry->level;
     }
@@ -280,13 +277,15 @@ xkb_key_get_group(struct xkb_state *state, xkb_keycode_t key)
 
     switch (XkbOutOfRangeGroupAction(info)) {
     case XkbRedirectIntoRange:
-        ret = XkbOutOfRangeGroupInfo(info);
+        ret = XkbOutOfRangeGroupNumber(info);
         if (ret >= num_groups)
             ret = 0;
         break;
+
     case XkbClampIntoRange:
         ret = num_groups - 1;
         break;
+
     case XkbWrapIntoRange:
     default:
         ret %= num_groups;
@@ -351,3 +350,12 @@ err:
     *syms_out = NULL;
     return 0;
 }
+
+/**
+ * Simple boolean specifying whether or not the key should repeat.
+ */
+_X_EXPORT int
+xkb_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t key)
+{
+    return !!(keymap->ctrls->per_key_repeat[key / 8] & (1 << (key % 8)));
+}