summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJengHyun Kang <jhyuni.kang@samsung.com>2016-04-25 18:05:46 +0900
committerJengHyun Kang <jhyuni.kang@samsung.com>2016-04-25 18:05:46 +0900
commit6677ebccaa4887d179f5a8a54a25442112cf5f54 (patch)
treea659c29e9be9dde0a51d9e3b2628c6527fa44e1b
parentb86c91bed526b8ae52257902b6c06964dd47359c (diff)
downloadlibxkbcommon-6677ebccaa4887d179f5a8a54a25442112cf5f54.tar.gz
libxkbcommon-6677ebccaa4887d179f5a8a54a25442112cf5f54.tar.bz2
libxkbcommon-6677ebccaa4887d179f5a8a54a25442112cf5f54.zip
Change-Id: If1644c4c6575b4eb7cadb8c1e11147651013d8ef
-rw-r--r--src/keymap.c14
-rw-r--r--xkbcommon/xkbcommon.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 6ed0408..36f8da4 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -483,3 +483,17 @@ xkb_keymap_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t kc)
return key->repeats;
}
+
+XKB_EXPORT int
+xkb_keymap_key_set_repeats(struct xkb_keymap *keymap, xkb_keycode_t kc, int enable)
+{
+ struct xkb_key *key = XkbKey(keymap, kc);
+
+ if (!key)
+ return 0;
+
+ key->repeats = !!enable;
+ key->explicit |= EXPLICIT_REPEAT;
+
+ return 1;
+}
diff --git a/xkbcommon/xkbcommon.h b/xkbcommon/xkbcommon.h
index 3f9fb6f..b42aa35 100644
--- a/xkbcommon/xkbcommon.h
+++ b/xkbcommon/xkbcommon.h
@@ -1120,6 +1120,10 @@ xkb_keymap_led_get_index(struct xkb_keymap *keymap, const char *name);
int
xkb_keymap_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t key);
+int
+xkb_keymap_key_set_repeats(struct xkb_keymap *keymap, xkb_keycode_t kc, int enable);
+
+
/** @} */
/**