make x11 keyboard repeat detectable

This commit is contained in:
Evan Tatarka 2014-09-14 18:12:37 -04:00
parent 485e89715f
commit bcd3da1fcd
2 changed files with 13 additions and 1 deletions

View file

@ -1406,6 +1406,8 @@ extern "C" {
pub fn glXMakeCurrent(dpy: *mut Display, drawable: GLXDrawable, pub fn glXMakeCurrent(dpy: *mut Display, drawable: GLXDrawable,
ctx: GLXContext) -> Bool; ctx: GLXContext) -> Bool;
pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable); pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable);
pub fn XkbSetDetectableAutoRepeat(dpy: *mut Display, detectable: bool, supported_rtm: *mut bool) -> bool;
} }
/* /*

View file

@ -179,6 +179,16 @@ impl Window {
ic 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 // creating GL context
let context = unsafe { let context = unsafe {
let mut attributes = Vec::new(); let mut attributes = Vec::new();