summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJengHyun Kang <jhyuni.kang@samsung.com>2016-04-25 18:05:46 +0900
committerSung-Jin Park <sj76.park@samsung.com>2017-10-20 16:39:37 +0900
commit9f4b764acc102602941bb3b49a90808db27c92e8 (patch)
treeb06cd762e81f4b2b74181f5b369e4259df9fa16f
parentf00e3a31160b3fe7302f63d1743b2769ca9d296a (diff)
downloadlibxkbcommon-9f4b764acc102602941bb3b49a90808db27c92e8.tar.gz
libxkbcommon-9f4b764acc102602941bb3b49a90808db27c92e8.tar.bz2
libxkbcommon-9f4b764acc102602941bb3b49a90808db27c92e8.zip
Add a new API to set key repeat
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 859c64a..799c7f0 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -517,3 +517,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 8b05835..d87d6a2 100644
--- a/xkbcommon/xkbcommon.h
+++ b/xkbcommon/xkbcommon.h
@@ -1171,6 +1171,10 @@ xkb_keymap_key_get_syms_by_level(struct xkb_keymap *keymap,
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);
+
+
/** @} */
/**