Remove XInput2 code for handling keyboard events

* For the moment we're still using plain core X11 events
   for handling keyboard activity, so remove the XInput2 code for that

 * Small refactoring of X11 input handling and documentation fixes
This commit is contained in:
Robert Knight 2015-06-28 21:55:54 +01:00
parent 94c31e42a4
commit cb08d9b05b
2 changed files with 35 additions and 58 deletions

View file

@ -177,15 +177,17 @@ impl<'a> Iterator for PollEventsIterator<'a> {
return Some(ev);
}
let xlib = &self.window.x.display.xlib;
loop {
let mut xev = unsafe { mem::uninitialized() };
let res = unsafe { (self.window.x.display.xlib.XCheckMaskEvent)(self.window.x.display.display, -1, &mut xev) };
let res = unsafe { (xlib.XCheckMaskEvent)(self.window.x.display.display, -1, &mut xev) };
if res == 0 {
let res = unsafe { (self.window.x.display.xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::ClientMessage, &mut xev) };
let res = unsafe { (xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::ClientMessage, &mut xev) };
if res == 0 {
let res = unsafe { (self.window.x.display.xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::GenericEvent, &mut xev) };
let res = unsafe { (xlib.XCheckTypedEvent)(self.window.x.display.display, ffi::GenericEvent, &mut xev) };
if res == 0 {
return None;
}
@ -194,7 +196,7 @@ impl<'a> Iterator for PollEventsIterator<'a> {
match xev.get_type() {
ffi::KeymapNotify => {
unsafe { (self.window.x.display.xlib.XRefreshKeyboardMapping)(mem::transmute(&xev)); }
unsafe { (xlib.XRefreshKeyboardMapping)(mem::transmute(&xev)); }
},
ffi::ClientMessage => {