aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2014-09-16 07:53:20 +0200
committertomaka <pierre.krieger1708@gmail.com>2014-09-16 07:53:20 +0200
commit1ae81267f56e5164201f897b99f5d3915146ff8d (patch)
treec0bab64faa970a3d3d1ce82bc725bb99eaba45d9 /src
parent661c936253bda31e5457cb74eca85d37582f0717 (diff)
parentbcd3da1fcd802330817bb0795f5a563ca093409b (diff)
downloadglutin-1ae81267f56e5164201f897b99f5d3915146ff8d.tar.gz
glutin-1ae81267f56e5164201f897b99f5d3915146ff8d.zip
Merge pull request #35 from evant/master
Make x11 keyboard repeat detectable
Diffstat (limited to 'src')
-rw-r--r--src/x11/ffi.rs4
-rw-r--r--src/x11/mod.rs10
2 files changed, 13 insertions, 1 deletions
diff --git a/src/x11/ffi.rs b/src/x11/ffi.rs
index d127a27..2bd2075 100644
--- a/src/x11/ffi.rs
+++ b/src/x11/ffi.rs
@@ -1406,6 +1406,8 @@ extern "C" {
pub fn glXMakeCurrent(dpy: *mut Display, drawable: GLXDrawable,
ctx: GLXContext) -> Bool;
pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable);
+
+ pub fn XkbSetDetectableAutoRepeat(dpy: *mut Display, detectable: bool, supported_rtm: *mut bool) -> bool;
}
/*
@@ -1462,4 +1464,4 @@ extern const char *glXGetClientString( Display *dpy, int name );
extern Display *glXGetCurrentDisplay( void );
-*/ \ No newline at end of file
+*/
diff --git a/src/x11/mod.rs b/src/x11/mod.rs
index 0710544..1b1e116 100644
--- a/src/x11/mod.rs
+++ b/src/x11/mod.rs
@@ -179,6 +179,16 @@ impl Window {
ic
};
+ // Attempt to make keyboard input repeat detectable
+ unsafe {
+ let mut supported_ptr = false;
+ ffi::XkbSetDetectableAutoRepeat(display, true, &mut supported_ptr);
+ if !supported_ptr {
+ return Err(format!("XkbSetDetectableAutoRepeat failed"));
+ }
+ }
+
+
// creating GL context
let context = unsafe {
let mut attributes = Vec::new();