diff --git a/src/platform/unix.rs b/src/platform/unix.rs index e68b0e760a..acc998c047 100644 --- a/src/platform/unix.rs +++ b/src/platform/unix.rs @@ -15,15 +15,15 @@ use platform_impl::{ EventLoop as LinuxEventLoop, Window as LinuxWindow, }; -//use platform_impl::x11::XConnection; -//use platform_impl::x11::ffi::XVisualInfo; -// +use platform_impl::x11::XConnection; +use platform_impl::x11::ffi::XVisualInfo; + // TODO: stupid hack so that glutin can do its work -//#[doc(hidden)] -//pub use platform_impl::x11; -// -//pub use platform_impl::XNotSupported; -//pub use platform_impl::x11::util::WindowType as XWindowType; +#[doc(hidden)] +pub use platform_impl::x11; + +pub use platform_impl::XNotSupported; +pub use platform_impl::x11::util::WindowType as XWindowType; /// Theme for wayland client side decorations /// @@ -96,8 +96,8 @@ impl Theme for WaylandThemeObject { /// Additional methods on `EventLoop` that are specific to Unix. pub trait EventLoopExtUnix { /// Builds a new `EventLoops` that is forced to use X11. - //fn new_x11() -> Result - // where Self: Sized; + fn new_x11() -> Result + where Self: Sized; /// Builds a new `EventLoop` that is forced to use Wayland. fn new_wayland() -> Self @@ -109,8 +109,8 @@ pub trait EventLoopExtUnix { /// True if the `EventLoop` uses X11. fn is_x11(&self) -> bool; - //#[doc(hidden)] - //fn get_xlib_xconnection(&self) -> Option>; + #[doc(hidden)] + fn get_xlib_xconnection(&self) -> Option>; /// Returns a pointer to the `wl_display` object of wayland that is used by this `EventsLoop`. /// @@ -121,15 +121,15 @@ pub trait EventLoopExtUnix { } impl EventLoopExtUnix for EventLoop { - //#[inline] - //fn new_x11() -> Result { - // LinuxEventLoop::new_x11().map(|ev| - // EventLoop { - // event_loop: ev, - // _marker: ::std::marker::PhantomData, - // } - // ) - //} + #[inline] + fn new_x11() -> Result { + LinuxEventLoop::new_x11().map(|ev| + EventLoop { + event_loop: ev, + _marker: ::std::marker::PhantomData, + } + ) + } #[inline] fn new_wayland() -> Self { @@ -152,11 +152,14 @@ impl EventLoopExtUnix for EventLoop { !self.event_loop.is_wayland() } - //#[inline] - //#[doc(hidden)] - //fn get_xlib_xconnection(&self) -> Option> { - // self.event_loop.x_connection().cloned() - //} + #[inline] + #[doc(hidden)] + fn get_xlib_xconnection(&self) -> Option> { + match self.event_loop { + LinuxEventLoop::X(ref e) => Some(e.x_connection().clone()), + _ => None + } + } #[inline] fn get_wayland_display(&self) -> Option<*mut raw::c_void> { @@ -183,8 +186,8 @@ pub trait WindowExtUnix { fn get_xlib_screen_id(&self) -> Option; - //#[doc(hidden)] - //fn get_xlib_xconnection(&self) -> Option>; + #[doc(hidden)] + fn get_xlib_xconnection(&self) -> Option>; /// Set window urgency hint (`XUrgencyHint`). Only relevant on X. fn set_urgent(&self, is_urgent: bool); @@ -227,7 +230,7 @@ impl WindowExtUnix for Window { #[inline] fn get_xlib_window(&self) -> Option { match self.window { - //LinuxWindow::X(ref w) => Some(w.get_xlib_window()), + LinuxWindow::X(ref w) => Some(w.get_xlib_window()), _ => None } } @@ -235,7 +238,7 @@ impl WindowExtUnix for Window { #[inline] fn get_xlib_display(&self) -> Option<*mut raw::c_void> { match self.window { - //LinuxWindow::X(ref w) => Some(w.get_xlib_display()), + LinuxWindow::X(ref w) => Some(w.get_xlib_display()), _ => None } } @@ -243,33 +246,33 @@ impl WindowExtUnix for Window { #[inline] fn get_xlib_screen_id(&self) -> Option { match self.window { - //LinuxWindow::X(ref w) => Some(w.get_xlib_screen_id()), + LinuxWindow::X(ref w) => Some(w.get_xlib_screen_id()), _ => None } } - //#[inline] - //#[doc(hidden)] - //fn get_xlib_xconnection(&self) -> Option> { - // match self.window { - // //LinuxWindow::X(ref w) => Some(w.get_xlib_xconnection()), - // _ => None - // } - //} + #[inline] + #[doc(hidden)] + fn get_xlib_xconnection(&self) -> Option> { + match self.window { + LinuxWindow::X(ref w) => Some(w.get_xlib_xconnection()), + _ => None + } + } #[inline] fn get_xcb_connection(&self) -> Option<*mut raw::c_void> { match self.window { - //LinuxWindow::X(ref w) => Some(w.get_xcb_connection()), + LinuxWindow::X(ref w) => Some(w.get_xcb_connection()), _ => None } } #[inline] fn set_urgent(&self, is_urgent: bool) { - //if let LinuxWindow::X(ref w) = self.window { - // w.set_urgent(is_urgent); - //} + if let LinuxWindow::X(ref w) = self.window { + w.set_urgent(is_urgent); + } } #[inline] @@ -312,7 +315,7 @@ pub trait WindowBuilderExtUnix { /// Build window with override-redirect flag; defaults to false. Only relevant on X11. fn with_override_redirect(self, override_redirect: bool) -> WindowBuilder; /// Build window with `_NET_WM_WINDOW_TYPE` hint; defaults to `Normal`. Only relevant on X11. - //fn with_x11_window_type(self, x11_window_type: XWindowType) -> WindowBuilder; + fn with_x11_window_type(self, x11_window_type: XWindowType) -> WindowBuilder; /// Build window with `_GTK_THEME_VARIANT` hint set to the specified value. Currently only relevant on X11. fn with_gtk_theme_variant(self, variant: String) -> WindowBuilder; /// Build window with resize increment hint. Only implemented on X11. @@ -331,9 +334,9 @@ pub trait WindowBuilderExtUnix { impl WindowBuilderExtUnix for WindowBuilder { #[inline] fn with_x11_visual(mut self, visual_infos: *const T) -> WindowBuilder { - //self.platform_specific.visual_infos = Some( - // unsafe { ptr::read(visual_infos as *const XVisualInfo) } - //); + self.platform_specific.visual_infos = Some( + unsafe { ptr::read(visual_infos as *const XVisualInfo) } + ); self } @@ -355,11 +358,11 @@ impl WindowBuilderExtUnix for WindowBuilder { self } - //#[inline] - //fn with_x11_window_type(mut self, x11_window_type: XWindowType) -> WindowBuilder { - // self.platform_specific.x11_window_type = x11_window_type; - // self - //} + #[inline] + fn with_x11_window_type(mut self, x11_window_type: XWindowType) -> WindowBuilder { + self.platform_specific.x11_window_type = x11_window_type; + self + } #[inline] fn with_resize_increments(mut self, increments: LogicalSize) -> WindowBuilder { diff --git a/src/platform_impl/linux/mod.rs b/src/platform_impl/linux/mod.rs index 94f324ed5d..f97bd04491 100644 --- a/src/platform_impl/linux/mod.rs +++ b/src/platform_impl/linux/mod.rs @@ -14,13 +14,13 @@ use icon::Icon; use event_loop::{EventLoopClosed, ControlFlow, EventLoopWindowTarget as RootELW}; use monitor::MonitorHandle as RootMonitorHandle; use window::{WindowAttributes, CreationError, MouseCursor}; -//use self::x11::{XConnection, XError}; -//use self::x11::ffi::XVisualInfo; -//pub use self::x11::XNotSupported; +use self::x11::{XConnection, XError}; +use self::x11::ffi::XVisualInfo; +pub use self::x11::XNotSupported; mod dlopen; pub mod wayland; -//pub mod x11; +pub mod x11; /// Environment variable specifying which backend should be used on unix platform. /// @@ -33,31 +33,31 @@ const BACKEND_PREFERENCE_ENV_VAR: &str = "WINIT_UNIX_BACKEND"; #[derive(Clone, Default)] pub struct PlatformSpecificWindowBuilderAttributes { - //pub visual_infos: Option, + pub visual_infos: Option, pub screen_id: Option, pub resize_increments: Option<(u32, u32)>, pub base_size: Option<(u32, u32)>, pub class: Option<(String, String)>, pub override_redirect: bool, - //pub x11_window_type: x11::util::WindowType, + pub x11_window_type: x11::util::WindowType, pub gtk_theme_variant: Option, pub app_id: Option } -//lazy_static!( -// pub static ref X11_BACKEND: Mutex, XNotSupported>> = { -// Mutex::new(XConnection::new(Some(x_error_callback)).map(Arc::new)) -// }; -//); +lazy_static!( + pub static ref X11_BACKEND: Mutex, XNotSupported>> = { + Mutex::new(XConnection::new(Some(x_error_callback)).map(Arc::new)) + }; +); pub enum Window { - //X(x11::Window), + X(x11::Window), Wayland(wayland::Window), } #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum WindowId { - //X(x11::WindowId), + X(x11::WindowId), Wayland(wayland::WindowId), } @@ -69,7 +69,7 @@ impl WindowId { #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DeviceId { - //X(x11::DeviceId), + X(x11::DeviceId), Wayland(wayland::DeviceId), } @@ -81,7 +81,7 @@ impl DeviceId { #[derive(Debug, Clone)] pub enum MonitorHandle { - //X(x11::MonitorHandle), + X(x11::MonitorHandle), Wayland(wayland::MonitorHandle), } @@ -89,7 +89,7 @@ impl MonitorHandle { #[inline] pub fn get_name(&self) -> Option { match self { - //&MonitorHandle::X(ref m) => m.get_name(), + &MonitorHandle::X(ref m) => m.get_name(), &MonitorHandle::Wayland(ref m) => m.get_name(), } } @@ -97,7 +97,7 @@ impl MonitorHandle { #[inline] pub fn get_native_identifier(&self) -> u32 { match self { - //&MonitorHandle::X(ref m) => m.get_native_identifier(), + &MonitorHandle::X(ref m) => m.get_native_identifier(), &MonitorHandle::Wayland(ref m) => m.get_native_identifier(), } } @@ -105,7 +105,7 @@ impl MonitorHandle { #[inline] pub fn get_dimensions(&self) -> PhysicalSize { match self { - //&MonitorHandle::X(ref m) => m.get_dimensions(), + &MonitorHandle::X(ref m) => m.get_dimensions(), &MonitorHandle::Wayland(ref m) => m.get_dimensions(), } } @@ -113,7 +113,7 @@ impl MonitorHandle { #[inline] pub fn get_position(&self) -> PhysicalPosition { match self { - //&MonitorHandle::X(ref m) => m.get_position(), + &MonitorHandle::X(ref m) => m.get_position(), &MonitorHandle::Wayland(ref m) => m.get_position(), } } @@ -121,7 +121,7 @@ impl MonitorHandle { #[inline] pub fn get_hidpi_factor(&self) -> f64 { match self { - //&MonitorHandle::X(ref m) => m.get_hidpi_factor(), + &MonitorHandle::X(ref m) => m.get_hidpi_factor(), &MonitorHandle::Wayland(ref m) => m.get_hidpi_factor() as f64, } } @@ -138,16 +138,16 @@ impl Window { EventLoopWindowTarget::Wayland(ref window_target) => { wayland::Window::new(window_target, attribs, pl_attribs).map(Window::Wayland) }, - //EventLoop::X(ref event_loop) => { - // x11::Window::new(event_loop, attribs, pl_attribs).map(Window::X) - //}, + EventLoopWindowTarget::X(ref window_target) => { + x11::Window::new(window_target, attribs, pl_attribs).map(Window::X) + }, } } #[inline] pub fn id(&self) -> WindowId { match self { - //&Window::X(ref w) => WindowId::X(w.id()), + &Window::X(ref w) => WindowId::X(w.id()), &Window::Wayland(ref w) => WindowId::Wayland(w.id()), } } @@ -155,7 +155,7 @@ impl Window { #[inline] pub fn set_title(&self, title: &str) { match self { - //&Window::X(ref w) => w.set_title(title), + &Window::X(ref w) => w.set_title(title), &Window::Wayland(ref w) => w.set_title(title), } } @@ -163,7 +163,7 @@ impl Window { #[inline] pub fn show(&self) { match self { - //&Window::X(ref w) => w.show(), + &Window::X(ref w) => w.show(), &Window::Wayland(ref w) => w.show(), } } @@ -171,7 +171,7 @@ impl Window { #[inline] pub fn hide(&self) { match self { - //&Window::X(ref w) => w.hide(), + &Window::X(ref w) => w.hide(), &Window::Wayland(ref w) => w.hide(), } } @@ -179,7 +179,7 @@ impl Window { #[inline] pub fn get_position(&self) -> Option { match self { - //&Window::X(ref w) => w.get_position(), + &Window::X(ref w) => w.get_position(), &Window::Wayland(ref w) => w.get_position(), } } @@ -187,7 +187,7 @@ impl Window { #[inline] pub fn get_inner_position(&self) -> Option { match self { - //&Window::X(ref m) => m.get_inner_position(), + &Window::X(ref m) => m.get_inner_position(), &Window::Wayland(ref m) => m.get_inner_position(), } } @@ -195,7 +195,7 @@ impl Window { #[inline] pub fn set_position(&self, position: LogicalPosition) { match self { - //&Window::X(ref w) => w.set_position(position), + &Window::X(ref w) => w.set_position(position), &Window::Wayland(ref w) => w.set_position(position), } } @@ -203,7 +203,7 @@ impl Window { #[inline] pub fn get_inner_size(&self) -> Option { match self { - //&Window::X(ref w) => w.get_inner_size(), + &Window::X(ref w) => w.get_inner_size(), &Window::Wayland(ref w) => w.get_inner_size(), } } @@ -211,7 +211,7 @@ impl Window { #[inline] pub fn get_outer_size(&self) -> Option { match self { - //&Window::X(ref w) => w.get_outer_size(), + &Window::X(ref w) => w.get_outer_size(), &Window::Wayland(ref w) => w.get_outer_size(), } } @@ -219,7 +219,7 @@ impl Window { #[inline] pub fn set_inner_size(&self, size: LogicalSize) { match self { - //&Window::X(ref w) => w.set_inner_size(size), + &Window::X(ref w) => w.set_inner_size(size), &Window::Wayland(ref w) => w.set_inner_size(size), } } @@ -227,7 +227,7 @@ impl Window { #[inline] pub fn set_min_dimensions(&self, dimensions: Option) { match self { - //&Window::X(ref w) => w.set_min_dimensions(dimensions), + &Window::X(ref w) => w.set_min_dimensions(dimensions), &Window::Wayland(ref w) => w.set_min_dimensions(dimensions), } } @@ -235,7 +235,7 @@ impl Window { #[inline] pub fn set_max_dimensions(&self, dimensions: Option) { match self { - //&Window::X(ref w) => w.set_max_dimensions(dimensions), + &Window::X(ref w) => w.set_max_dimensions(dimensions), &Window::Wayland(ref w) => w.set_max_dimensions(dimensions), } } @@ -243,7 +243,7 @@ impl Window { #[inline] pub fn set_resizable(&self, resizable: bool) { match self { - //&Window::X(ref w) => w.set_resizable(resizable), + &Window::X(ref w) => w.set_resizable(resizable), &Window::Wayland(ref w) => w.set_resizable(resizable), } } @@ -251,7 +251,7 @@ impl Window { #[inline] pub fn set_cursor(&self, cursor: MouseCursor) { match self { - //&Window::X(ref w) => w.set_cursor(cursor), + &Window::X(ref w) => w.set_cursor(cursor), &Window::Wayland(ref w) => w.set_cursor(cursor) } } @@ -259,7 +259,7 @@ impl Window { #[inline] pub fn grab_cursor(&self, grab: bool) -> Result<(), String> { match self { - //&Window::X(ref window) => window.grab_cursor(grab), + &Window::X(ref window) => window.grab_cursor(grab), &Window::Wayland(ref window) => window.grab_cursor(grab), } } @@ -267,7 +267,7 @@ impl Window { #[inline] pub fn hide_cursor(&self, hide: bool) { match self { - //&Window::X(ref window) => window.hide_cursor(hide), + &Window::X(ref window) => window.hide_cursor(hide), &Window::Wayland(ref window) => window.hide_cursor(hide), } } @@ -275,7 +275,7 @@ impl Window { #[inline] pub fn get_hidpi_factor(&self) -> f64 { match self { - //&Window::X(ref w) => w.get_hidpi_factor(), + &Window::X(ref w) => w.get_hidpi_factor(), &Window::Wayland(ref w) => w.hidpi_factor() as f64, } } @@ -283,7 +283,7 @@ impl Window { #[inline] pub fn set_cursor_position(&self, position: LogicalPosition) -> Result<(), String> { match self { - //&Window::X(ref w) => w.set_cursor_position(position), + &Window::X(ref w) => w.set_cursor_position(position), &Window::Wayland(ref w) => w.set_cursor_position(position), } } @@ -291,7 +291,7 @@ impl Window { #[inline] pub fn set_maximized(&self, maximized: bool) { match self { - //&Window::X(ref w) => w.set_maximized(maximized), + &Window::X(ref w) => w.set_maximized(maximized), &Window::Wayland(ref w) => w.set_maximized(maximized), } } @@ -299,7 +299,7 @@ impl Window { #[inline] pub fn set_fullscreen(&self, monitor: Option) { match self { - //&Window::X(ref w) => w.set_fullscreen(monitor), + &Window::X(ref w) => w.set_fullscreen(monitor), &Window::Wayland(ref w) => w.set_fullscreen(monitor) } } @@ -307,7 +307,7 @@ impl Window { #[inline] pub fn set_decorations(&self, decorations: bool) { match self { - //&Window::X(ref w) => w.set_decorations(decorations), + &Window::X(ref w) => w.set_decorations(decorations), &Window::Wayland(ref w) => w.set_decorations(decorations) } } @@ -315,7 +315,7 @@ impl Window { #[inline] pub fn set_always_on_top(&self, always_on_top: bool) { match self { - //&Window::X(ref w) => w.set_always_on_top(always_on_top), + &Window::X(ref w) => w.set_always_on_top(always_on_top), &Window::Wayland(_) => (), } } @@ -323,7 +323,7 @@ impl Window { #[inline] pub fn set_window_icon(&self, window_icon: Option) { match self { - //&Window::X(ref w) => w.set_window_icon(window_icon), + &Window::X(ref w) => w.set_window_icon(window_icon), &Window::Wayland(_) => (), } } @@ -331,7 +331,7 @@ impl Window { #[inline] pub fn set_ime_spot(&self, position: LogicalPosition) { match self { - //&Window::X(ref w) => w.set_ime_spot(position), + &Window::X(ref w) => w.set_ime_spot(position), &Window::Wayland(_) => (), } } @@ -339,7 +339,7 @@ impl Window { #[inline] pub fn request_redraw(&self) { match self { - //&Window::X(ref w) => w.request_redraw(), + &Window::X(ref w) => w.request_redraw(), &Window::Wayland(ref w) => w.request_redraw(), } } @@ -347,7 +347,7 @@ impl Window { #[inline] pub fn get_current_monitor(&self) -> RootMonitorHandle { match self { - //&Window::X(ref window) => RootMonitorHandle { inner: MonitorHandle::X(window.get_current_monitor()) }, + &Window::X(ref window) => RootMonitorHandle { inner: MonitorHandle::X(window.get_current_monitor()) }, &Window::Wayland(ref window) => RootMonitorHandle { inner: MonitorHandle::Wayland(window.get_current_monitor()) }, } } @@ -355,10 +355,10 @@ impl Window { #[inline] pub fn get_available_monitors(&self) -> VecDeque { match self { - //&Window::X(ref window) => window.get_available_monitors() - // .into_iter() - // .map(MonitorHandle::X) - // .collect(), + &Window::X(ref window) => window.get_available_monitors() + .into_iter() + .map(MonitorHandle::X) + .collect(), &Window::Wayland(ref window) => window.get_available_monitors() .into_iter() .map(MonitorHandle::Wayland) @@ -369,13 +369,13 @@ impl Window { #[inline] pub fn get_primary_monitor(&self) -> MonitorHandle { match self { - //&Window::X(ref window) => MonitorHandle::X(window.get_primary_monitor()), + &Window::X(ref window) => MonitorHandle::X(window.get_primary_monitor()), &Window::Wayland(ref window) => MonitorHandle::Wayland(window.get_primary_monitor()), } } } -/* + unsafe extern "C" fn x_error_callback( display: *mut x11::ffi::Display, event: *mut x11::ffi::XErrorEvent, @@ -405,16 +405,16 @@ unsafe extern "C" fn x_error_callback( // Fun fact: this return value is completely ignored. 0 } -*/ + pub enum EventLoop { Wayland(wayland::EventLoop), - //X(x11::EventLoop) + X(x11::EventLoop) } #[derive(Clone)] pub enum EventLoopProxy { - //X(x11::EventLoopProxy), + X(x11::EventLoopProxy), Wayland(wayland::EventLoopProxy), } @@ -460,15 +460,14 @@ impl EventLoop { .map(EventLoop::Wayland) } - pub fn new_x11() -> Result, () /*XNotSupported*/> { - //X11_BACKEND - // .lock() - // .as_ref() - // .map(Arc::clone) - // .map(x11::EventLoop::new) - // .map(EventLoop::X) - // .map_err(|err| err.clone()) - unimplemented!() + pub fn new_x11() -> Result, XNotSupported> { + X11_BACKEND + .lock() + .as_ref() + .map(Arc::clone) + .map(x11::EventLoop::new) + .map(EventLoop::X) + .map_err(|err| err.clone()) } #[inline] @@ -479,12 +478,12 @@ impl EventLoop { .into_iter() .map(MonitorHandle::Wayland) .collect(), - //EventLoop::X(ref evlp) => evlp - // .x_connection() - // .get_available_monitors() - // .into_iter() - // .map(MonitorHandle::X) - // .collect(), + EventLoop::X(ref evlp) => evlp + .x_connection() + .get_available_monitors() + .into_iter() + .map(MonitorHandle::X) + .collect(), } } @@ -492,14 +491,14 @@ impl EventLoop { pub fn get_primary_monitor(&self) -> MonitorHandle { match *self { EventLoop::Wayland(ref evlp) => MonitorHandle::Wayland(evlp.get_primary_monitor()), - //EventLoop::X(ref evlp) => MonitorHandle::X(evlp.x_connection().get_primary_monitor()), + EventLoop::X(ref evlp) => MonitorHandle::X(evlp.x_connection().get_primary_monitor()), } } pub fn create_proxy(&self) -> EventLoopProxy { match *self { EventLoop::Wayland(ref evlp) => EventLoopProxy::Wayland(evlp.create_proxy()), - //EventLoop::X(ref evlp) => EventLoopProxy::X(evlp.create_proxy()), + EventLoop::X(ref evlp) => EventLoopProxy::X(evlp.create_proxy()), } } @@ -508,7 +507,7 @@ impl EventLoop { { match *self { EventLoop::Wayland(ref mut evlp) => evlp.run_return(callback), - //EventLoop::X(ref mut evlp) => evlp.run_return(callback) + EventLoop::X(ref mut evlp) => evlp.run_return(callback) } } @@ -517,7 +516,7 @@ impl EventLoop { { match self { EventLoop::Wayland(evlp) => evlp.run(callback), - //EventLoop::X(ref mut evlp) => evlp.run(callback) + EventLoop::X(evlp) => evlp.run(callback) } } @@ -525,36 +524,28 @@ impl EventLoop { pub fn is_wayland(&self) -> bool { match *self { EventLoop::Wayland(_) => true, - //EventLoop::X(_) => false, + EventLoop::X(_) => false, } } pub fn window_target(&self) -> &::event_loop::EventLoopWindowTarget { match *self { EventLoop::Wayland(ref evl) => evl.window_target(), - //EventLoop::X(ref evl) => evl.window_target() + EventLoop::X(ref evl) => evl.window_target() } } - - //#[inline] - //pub fn x_connection(&self) -> Option<&Arc> { - // match *self { - // EventLoop::Wayland(_) => None, - // EventLoop::X(ref ev) => Some(ev.x_connection()), - // } - //} } impl EventLoopProxy { pub fn send_event(&self, event: T) -> Result<(), EventLoopClosed> { match *self { EventLoopProxy::Wayland(ref proxy) => proxy.send_event(event), - //EventLoopProxy::X(ref proxy) => proxy.wakeup(), + EventLoopProxy::X(ref proxy) => proxy.send_event(event), } } } pub enum EventLoopWindowTarget { Wayland(wayland::EventLoopWindowTarget), - //X(x11::EventLoopWIndowTarget) + X(x11::EventLoopWindowTarget) } diff --git a/src/platform_impl/linux/x11/events.rs b/src/platform_impl/linux/x11/events.rs index 853064134a..254f04e103 100644 --- a/src/platform_impl/linux/x11/events.rs +++ b/src/platform_impl/linux/x11/events.rs @@ -1,1003 +1,1003 @@ -use {events, libc}; +use libc; use super::ffi; -use VirtualKeyCode; +use event::VirtualKeyCode; pub fn keysym_to_element(keysym: libc::c_uint) -> Option { Some(match keysym { - ffi::XK_BackSpace => events::VirtualKeyCode::Back, - ffi::XK_Tab => events::VirtualKeyCode::Tab, - //ffi::XK_Linefeed => events::VirtualKeyCode::Linefeed, - //ffi::XK_Clear => events::VirtualKeyCode::Clear, - ffi::XK_Return => events::VirtualKeyCode::Return, - //ffi::XK_Pause => events::VirtualKeyCode::Pause, - //ffi::XK_Scroll_Lock => events::VirtualKeyCode::Scroll_lock, - //ffi::XK_Sys_Req => events::VirtualKeyCode::Sys_req, - ffi::XK_Escape => events::VirtualKeyCode::Escape, - ffi::XK_Delete => events::VirtualKeyCode::Delete, - ffi::XK_Multi_key => events::VirtualKeyCode::Compose, - //ffi::XK_Kanji => events::VirtualKeyCode::Kanji, - //ffi::XK_Muhenkan => events::VirtualKeyCode::Muhenkan, - //ffi::XK_Henkan_Mode => events::VirtualKeyCode::Henkan_mode, - //ffi::XK_Henkan => events::VirtualKeyCode::Henkan, - //ffi::XK_Romaji => events::VirtualKeyCode::Romaji, - //ffi::XK_Hiragana => events::VirtualKeyCode::Hiragana, - //ffi::XK_Katakana => events::VirtualKeyCode::Katakana, - //ffi::XK_Hiragana_Katakana => events::VirtualKeyCode::Hiragana_katakana, - //ffi::XK_Zenkaku => events::VirtualKeyCode::Zenkaku, - //ffi::XK_Hankaku => events::VirtualKeyCode::Hankaku, - //ffi::XK_Zenkaku_Hankaku => events::VirtualKeyCode::Zenkaku_hankaku, - //ffi::XK_Touroku => events::VirtualKeyCode::Touroku, - //ffi::XK_Massyo => events::VirtualKeyCode::Massyo, - //ffi::XK_Kana_Lock => events::VirtualKeyCode::Kana_lock, - //ffi::XK_Kana_Shift => events::VirtualKeyCode::Kana_shift, - //ffi::XK_Eisu_Shift => events::VirtualKeyCode::Eisu_shift, - //ffi::XK_Eisu_toggle => events::VirtualKeyCode::Eisu_toggle, - ffi::XK_Home => events::VirtualKeyCode::Home, - ffi::XK_Left => events::VirtualKeyCode::Left, - ffi::XK_Up => events::VirtualKeyCode::Up, - ffi::XK_Right => events::VirtualKeyCode::Right, - ffi::XK_Down => events::VirtualKeyCode::Down, - //ffi::XK_Prior => events::VirtualKeyCode::Prior, - ffi::XK_Page_Up => events::VirtualKeyCode::PageUp, - //ffi::XK_Next => events::VirtualKeyCode::Next, - ffi::XK_Page_Down => events::VirtualKeyCode::PageDown, - ffi::XK_End => events::VirtualKeyCode::End, - //ffi::XK_Begin => events::VirtualKeyCode::Begin, - //ffi::XK_Win_L => events::VirtualKeyCode::Win_l, - //ffi::XK_Win_R => events::VirtualKeyCode::Win_r, - //ffi::XK_App => events::VirtualKeyCode::App, - //ffi::XK_Select => events::VirtualKeyCode::Select, - //ffi::XK_Print => events::VirtualKeyCode::Print, - //ffi::XK_Execute => events::VirtualKeyCode::Execute, - ffi::XK_Insert => events::VirtualKeyCode::Insert, - //ffi::XK_Undo => events::VirtualKeyCode::Undo, - //ffi::XK_Redo => events::VirtualKeyCode::Redo, - //ffi::XK_Menu => events::VirtualKeyCode::Menu, - //ffi::XK_Find => events::VirtualKeyCode::Find, - //ffi::XK_Cancel => events::VirtualKeyCode::Cancel, - //ffi::XK_Help => events::VirtualKeyCode::Help, - //ffi::XK_Break => events::VirtualKeyCode::Break, - //ffi::XK_Mode_switch => events::VirtualKeyCode::Mode_switch, - //ffi::XK_script_switch => events::VirtualKeyCode::Script_switch, - //ffi::XK_Num_Lock => events::VirtualKeyCode::Num_lock, - //ffi::XK_KP_Space => events::VirtualKeyCode::Kp_space, - //ffi::XK_KP_Tab => events::VirtualKeyCode::Kp_tab, - //ffi::XK_KP_Enter => events::VirtualKeyCode::Kp_enter, - //ffi::XK_KP_F1 => events::VirtualKeyCode::Kp_f1, - //ffi::XK_KP_F2 => events::VirtualKeyCode::Kp_f2, - //ffi::XK_KP_F3 => events::VirtualKeyCode::Kp_f3, - //ffi::XK_KP_F4 => events::VirtualKeyCode::Kp_f4, - ffi::XK_KP_Home => events::VirtualKeyCode::Home, - ffi::XK_KP_Left => events::VirtualKeyCode::Left, - ffi::XK_KP_Up => events::VirtualKeyCode::Up, - ffi::XK_KP_Right => events::VirtualKeyCode::Right, - ffi::XK_KP_Down => events::VirtualKeyCode::Down, - //ffi::XK_KP_Prior => events::VirtualKeyCode::Kp_prior, - ffi::XK_KP_Page_Up => events::VirtualKeyCode::PageUp, - //ffi::XK_KP_Next => events::VirtualKeyCode::Kp_next, - ffi::XK_KP_Page_Down => events::VirtualKeyCode::PageDown, - ffi::XK_KP_End => events::VirtualKeyCode::End, - //ffi::XK_KP_Begin => events::VirtualKeyCode::Kp_begin, - ffi::XK_KP_Insert => events::VirtualKeyCode::Insert, - ffi::XK_KP_Delete => events::VirtualKeyCode::Delete, - ffi::XK_KP_Equal => events::VirtualKeyCode::NumpadEquals, - //ffi::XK_KP_Multiply => events::VirtualKeyCode::NumpadMultiply, - ffi::XK_KP_Add => events::VirtualKeyCode::Add, - //ffi::XK_KP_Separator => events::VirtualKeyCode::Kp_separator, - ffi::XK_KP_Subtract => events::VirtualKeyCode::Subtract, - //ffi::XK_KP_Decimal => events::VirtualKeyCode::Kp_decimal, - ffi::XK_KP_Divide => events::VirtualKeyCode::Divide, - ffi::XK_KP_0 => events::VirtualKeyCode::Numpad0, - ffi::XK_KP_1 => events::VirtualKeyCode::Numpad1, - ffi::XK_KP_2 => events::VirtualKeyCode::Numpad2, - ffi::XK_KP_3 => events::VirtualKeyCode::Numpad3, - ffi::XK_KP_4 => events::VirtualKeyCode::Numpad4, - ffi::XK_KP_5 => events::VirtualKeyCode::Numpad5, - ffi::XK_KP_6 => events::VirtualKeyCode::Numpad6, - ffi::XK_KP_7 => events::VirtualKeyCode::Numpad7, - ffi::XK_KP_8 => events::VirtualKeyCode::Numpad8, - ffi::XK_KP_9 => events::VirtualKeyCode::Numpad9, - ffi::XK_F1 => events::VirtualKeyCode::F1, - ffi::XK_F2 => events::VirtualKeyCode::F2, - ffi::XK_F3 => events::VirtualKeyCode::F3, - ffi::XK_F4 => events::VirtualKeyCode::F4, - ffi::XK_F5 => events::VirtualKeyCode::F5, - ffi::XK_F6 => events::VirtualKeyCode::F6, - ffi::XK_F7 => events::VirtualKeyCode::F7, - ffi::XK_F8 => events::VirtualKeyCode::F8, - ffi::XK_F9 => events::VirtualKeyCode::F9, - ffi::XK_F10 => events::VirtualKeyCode::F10, - ffi::XK_F11 => events::VirtualKeyCode::F11, - //ffi::XK_L1 => events::VirtualKeyCode::L1, - ffi::XK_F12 => events::VirtualKeyCode::F12, - //ffi::XK_L2 => events::VirtualKeyCode::L2, - ffi::XK_F13 => events::VirtualKeyCode::F13, - //ffi::XK_L3 => events::VirtualKeyCode::L3, - ffi::XK_F14 => events::VirtualKeyCode::F14, - //ffi::XK_L4 => events::VirtualKeyCode::L4, - ffi::XK_F15 => events::VirtualKeyCode::F15, - //ffi::XK_L5 => events::VirtualKeyCode::L5, - ffi::XK_F16 => events::VirtualKeyCode::F16, - //ffi::XK_L6 => events::VirtualKeyCode::L6, - ffi::XK_F17 => events::VirtualKeyCode::F17, - //ffi::XK_L7 => events::VirtualKeyCode::L7, - ffi::XK_F18 => events::VirtualKeyCode::F18, - //ffi::XK_L8 => events::VirtualKeyCode::L8, - ffi::XK_F19 => events::VirtualKeyCode::F19, - //ffi::XK_L9 => events::VirtualKeyCode::L9, - ffi::XK_F20 => events::VirtualKeyCode::F20, - //ffi::XK_L10 => events::VirtualKeyCode::L10, - ffi::XK_F21 => events::VirtualKeyCode::F21, - //ffi::XK_R1 => events::VirtualKeyCode::R1, - ffi::XK_F22 => events::VirtualKeyCode::F22, - //ffi::XK_R2 => events::VirtualKeyCode::R2, - ffi::XK_F23 => events::VirtualKeyCode::F23, - //ffi::XK_R3 => events::VirtualKeyCode::R3, - ffi::XK_F24 => events::VirtualKeyCode::F24, - //ffi::XK_R4 => events::VirtualKeyCode::R4, - //ffi::XK_F25 => events::VirtualKeyCode::F25, - //ffi::XK_R5 => events::VirtualKeyCode::R5, - //ffi::XK_F26 => events::VirtualKeyCode::F26, - //ffi::XK_R6 => events::VirtualKeyCode::R6, - //ffi::XK_F27 => events::VirtualKeyCode::F27, - //ffi::XK_R7 => events::VirtualKeyCode::R7, - //ffi::XK_F28 => events::VirtualKeyCode::F28, - //ffi::XK_R8 => events::VirtualKeyCode::R8, - //ffi::XK_F29 => events::VirtualKeyCode::F29, - //ffi::XK_R9 => events::VirtualKeyCode::R9, - //ffi::XK_F30 => events::VirtualKeyCode::F30, - //ffi::XK_R10 => events::VirtualKeyCode::R10, - //ffi::XK_F31 => events::VirtualKeyCode::F31, - //ffi::XK_R11 => events::VirtualKeyCode::R11, - //ffi::XK_F32 => events::VirtualKeyCode::F32, - //ffi::XK_R12 => events::VirtualKeyCode::R12, - //ffi::XK_F33 => events::VirtualKeyCode::F33, - //ffi::XK_R13 => events::VirtualKeyCode::R13, - //ffi::XK_F34 => events::VirtualKeyCode::F34, - //ffi::XK_R14 => events::VirtualKeyCode::R14, - //ffi::XK_F35 => events::VirtualKeyCode::F35, - //ffi::XK_R15 => events::VirtualKeyCode::R15, - ffi::XK_Shift_L => events::VirtualKeyCode::LShift, - ffi::XK_Shift_R => events::VirtualKeyCode::RShift, - ffi::XK_Control_L => events::VirtualKeyCode::LControl, - ffi::XK_Control_R => events::VirtualKeyCode::RControl, - //ffi::XK_Caps_Lock => events::VirtualKeyCode::Caps_lock, - //ffi::XK_Shift_Lock => events::VirtualKeyCode::Shift_lock, - //ffi::XK_Meta_L => events::VirtualKeyCode::Meta_l, - //ffi::XK_Meta_R => events::VirtualKeyCode::Meta_r, - ffi::XK_Alt_L => events::VirtualKeyCode::LAlt, - ffi::XK_Alt_R => events::VirtualKeyCode::RAlt, - //ffi::XK_Super_L => events::VirtualKeyCode::Super_l, - //ffi::XK_Super_R => events::VirtualKeyCode::Super_r, - //ffi::XK_Hyper_L => events::VirtualKeyCode::Hyper_l, - //ffi::XK_Hyper_R => events::VirtualKeyCode::Hyper_r, - ffi::XK_ISO_Left_Tab => events::VirtualKeyCode::Tab, - ffi::XK_space => events::VirtualKeyCode::Space, - //ffi::XK_exclam => events::VirtualKeyCode::Exclam, - //ffi::XK_quotedbl => events::VirtualKeyCode::Quotedbl, - //ffi::XK_numbersign => events::VirtualKeyCode::Numbersign, - //ffi::XK_dollar => events::VirtualKeyCode::Dollar, - //ffi::XK_percent => events::VirtualKeyCode::Percent, - //ffi::XK_ampersand => events::VirtualKeyCode::Ampersand, - ffi::XK_apostrophe => events::VirtualKeyCode::Apostrophe, - //ffi::XK_quoteright => events::VirtualKeyCode::Quoteright, - //ffi::XK_parenleft => events::VirtualKeyCode::Parenleft, - //ffi::XK_parenright => events::VirtualKeyCode::Parenright, - //ffi::XK_asterisk => events::VirtualKeyCode::Asterisk, - ffi::XK_plus => events::VirtualKeyCode::Add, - ffi::XK_comma => events::VirtualKeyCode::Comma, - ffi::XK_minus => events::VirtualKeyCode::Subtract, - ffi::XK_period => events::VirtualKeyCode::Period, - ffi::XK_slash => events::VirtualKeyCode::Slash, - ffi::XK_0 => events::VirtualKeyCode::Key0, - ffi::XK_1 => events::VirtualKeyCode::Key1, - ffi::XK_2 => events::VirtualKeyCode::Key2, - ffi::XK_3 => events::VirtualKeyCode::Key3, - ffi::XK_4 => events::VirtualKeyCode::Key4, - ffi::XK_5 => events::VirtualKeyCode::Key5, - ffi::XK_6 => events::VirtualKeyCode::Key6, - ffi::XK_7 => events::VirtualKeyCode::Key7, - ffi::XK_8 => events::VirtualKeyCode::Key8, - ffi::XK_9 => events::VirtualKeyCode::Key9, - ffi::XK_colon => events::VirtualKeyCode::Colon, - ffi::XK_semicolon => events::VirtualKeyCode::Semicolon, - //ffi::XK_less => events::VirtualKeyCode::Less, - ffi::XK_equal => events::VirtualKeyCode::Equals, - //ffi::XK_greater => events::VirtualKeyCode::Greater, - //ffi::XK_question => events::VirtualKeyCode::Question, - ffi::XK_at => events::VirtualKeyCode::At, - ffi::XK_A => events::VirtualKeyCode::A, - ffi::XK_B => events::VirtualKeyCode::B, - ffi::XK_C => events::VirtualKeyCode::C, - ffi::XK_D => events::VirtualKeyCode::D, - ffi::XK_E => events::VirtualKeyCode::E, - ffi::XK_F => events::VirtualKeyCode::F, - ffi::XK_G => events::VirtualKeyCode::G, - ffi::XK_H => events::VirtualKeyCode::H, - ffi::XK_I => events::VirtualKeyCode::I, - ffi::XK_J => events::VirtualKeyCode::J, - ffi::XK_K => events::VirtualKeyCode::K, - ffi::XK_L => events::VirtualKeyCode::L, - ffi::XK_M => events::VirtualKeyCode::M, - ffi::XK_N => events::VirtualKeyCode::N, - ffi::XK_O => events::VirtualKeyCode::O, - ffi::XK_P => events::VirtualKeyCode::P, - ffi::XK_Q => events::VirtualKeyCode::Q, - ffi::XK_R => events::VirtualKeyCode::R, - ffi::XK_S => events::VirtualKeyCode::S, - ffi::XK_T => events::VirtualKeyCode::T, - ffi::XK_U => events::VirtualKeyCode::U, - ffi::XK_V => events::VirtualKeyCode::V, - ffi::XK_W => events::VirtualKeyCode::W, - ffi::XK_X => events::VirtualKeyCode::X, - ffi::XK_Y => events::VirtualKeyCode::Y, - ffi::XK_Z => events::VirtualKeyCode::Z, - ffi::XK_bracketleft => events::VirtualKeyCode::LBracket, - ffi::XK_backslash => events::VirtualKeyCode::Backslash, - ffi::XK_bracketright => events::VirtualKeyCode::RBracket, - //ffi::XK_asciicircum => events::VirtualKeyCode::Asciicircum, - //ffi::XK_underscore => events::VirtualKeyCode::Underscore, - ffi::XK_grave => events::VirtualKeyCode::Grave, - //ffi::XK_quoteleft => events::VirtualKeyCode::Quoteleft, - ffi::XK_a => events::VirtualKeyCode::A, - ffi::XK_b => events::VirtualKeyCode::B, - ffi::XK_c => events::VirtualKeyCode::C, - ffi::XK_d => events::VirtualKeyCode::D, - ffi::XK_e => events::VirtualKeyCode::E, - ffi::XK_f => events::VirtualKeyCode::F, - ffi::XK_g => events::VirtualKeyCode::G, - ffi::XK_h => events::VirtualKeyCode::H, - ffi::XK_i => events::VirtualKeyCode::I, - ffi::XK_j => events::VirtualKeyCode::J, - ffi::XK_k => events::VirtualKeyCode::K, - ffi::XK_l => events::VirtualKeyCode::L, - ffi::XK_m => events::VirtualKeyCode::M, - ffi::XK_n => events::VirtualKeyCode::N, - ffi::XK_o => events::VirtualKeyCode::O, - ffi::XK_p => events::VirtualKeyCode::P, - ffi::XK_q => events::VirtualKeyCode::Q, - ffi::XK_r => events::VirtualKeyCode::R, - ffi::XK_s => events::VirtualKeyCode::S, - ffi::XK_t => events::VirtualKeyCode::T, - ffi::XK_u => events::VirtualKeyCode::U, - ffi::XK_v => events::VirtualKeyCode::V, - ffi::XK_w => events::VirtualKeyCode::W, - ffi::XK_x => events::VirtualKeyCode::X, - ffi::XK_y => events::VirtualKeyCode::Y, - ffi::XK_z => events::VirtualKeyCode::Z, - //ffi::XK_braceleft => events::VirtualKeyCode::Braceleft, - //ffi::XK_bar => events::VirtualKeyCode::Bar, - //ffi::XK_braceright => events::VirtualKeyCode::Braceright, - //ffi::XK_asciitilde => events::VirtualKeyCode::Asciitilde, - //ffi::XK_nobreakspace => events::VirtualKeyCode::Nobreakspace, - //ffi::XK_exclamdown => events::VirtualKeyCode::Exclamdown, - //ffi::XK_cent => events::VirtualKeyCode::Cent, - //ffi::XK_sterling => events::VirtualKeyCode::Sterling, - //ffi::XK_currency => events::VirtualKeyCode::Currency, - //ffi::XK_yen => events::VirtualKeyCode::Yen, - //ffi::XK_brokenbar => events::VirtualKeyCode::Brokenbar, - //ffi::XK_section => events::VirtualKeyCode::Section, - //ffi::XK_diaeresis => events::VirtualKeyCode::Diaeresis, - //ffi::XK_copyright => events::VirtualKeyCode::Copyright, - //ffi::XK_ordfeminine => events::VirtualKeyCode::Ordfeminine, - //ffi::XK_guillemotleft => events::VirtualKeyCode::Guillemotleft, - //ffi::XK_notsign => events::VirtualKeyCode::Notsign, - //ffi::XK_hyphen => events::VirtualKeyCode::Hyphen, - //ffi::XK_registered => events::VirtualKeyCode::Registered, - //ffi::XK_macron => events::VirtualKeyCode::Macron, - //ffi::XK_degree => events::VirtualKeyCode::Degree, - //ffi::XK_plusminus => events::VirtualKeyCode::Plusminus, - //ffi::XK_twosuperior => events::VirtualKeyCode::Twosuperior, - //ffi::XK_threesuperior => events::VirtualKeyCode::Threesuperior, - //ffi::XK_acute => events::VirtualKeyCode::Acute, - //ffi::XK_mu => events::VirtualKeyCode::Mu, - //ffi::XK_paragraph => events::VirtualKeyCode::Paragraph, - //ffi::XK_periodcentered => events::VirtualKeyCode::Periodcentered, - //ffi::XK_cedilla => events::VirtualKeyCode::Cedilla, - //ffi::XK_onesuperior => events::VirtualKeyCode::Onesuperior, - //ffi::XK_masculine => events::VirtualKeyCode::Masculine, - //ffi::XK_guillemotright => events::VirtualKeyCode::Guillemotright, - //ffi::XK_onequarter => events::VirtualKeyCode::Onequarter, - //ffi::XK_onehalf => events::VirtualKeyCode::Onehalf, - //ffi::XK_threequarters => events::VirtualKeyCode::Threequarters, - //ffi::XK_questiondown => events::VirtualKeyCode::Questiondown, - //ffi::XK_Agrave => events::VirtualKeyCode::Agrave, - //ffi::XK_Aacute => events::VirtualKeyCode::Aacute, - //ffi::XK_Acircumflex => events::VirtualKeyCode::Acircumflex, - //ffi::XK_Atilde => events::VirtualKeyCode::Atilde, - //ffi::XK_Adiaeresis => events::VirtualKeyCode::Adiaeresis, - //ffi::XK_Aring => events::VirtualKeyCode::Aring, - //ffi::XK_AE => events::VirtualKeyCode::Ae, - //ffi::XK_Ccedilla => events::VirtualKeyCode::Ccedilla, - //ffi::XK_Egrave => events::VirtualKeyCode::Egrave, - //ffi::XK_Eacute => events::VirtualKeyCode::Eacute, - //ffi::XK_Ecircumflex => events::VirtualKeyCode::Ecircumflex, - //ffi::XK_Ediaeresis => events::VirtualKeyCode::Ediaeresis, - //ffi::XK_Igrave => events::VirtualKeyCode::Igrave, - //ffi::XK_Iacute => events::VirtualKeyCode::Iacute, - //ffi::XK_Icircumflex => events::VirtualKeyCode::Icircumflex, - //ffi::XK_Idiaeresis => events::VirtualKeyCode::Idiaeresis, - //ffi::XK_ETH => events::VirtualKeyCode::Eth, - //ffi::XK_Eth => events::VirtualKeyCode::Eth, - //ffi::XK_Ntilde => events::VirtualKeyCode::Ntilde, - //ffi::XK_Ograve => events::VirtualKeyCode::Ograve, - //ffi::XK_Oacute => events::VirtualKeyCode::Oacute, - //ffi::XK_Ocircumflex => events::VirtualKeyCode::Ocircumflex, - //ffi::XK_Otilde => events::VirtualKeyCode::Otilde, - //ffi::XK_Odiaeresis => events::VirtualKeyCode::Odiaeresis, - //ffi::XK_multiply => events::VirtualKeyCode::Multiply, - //ffi::XK_Ooblique => events::VirtualKeyCode::Ooblique, - //ffi::XK_Ugrave => events::VirtualKeyCode::Ugrave, - //ffi::XK_Uacute => events::VirtualKeyCode::Uacute, - //ffi::XK_Ucircumflex => events::VirtualKeyCode::Ucircumflex, - //ffi::XK_Udiaeresis => events::VirtualKeyCode::Udiaeresis, - //ffi::XK_Yacute => events::VirtualKeyCode::Yacute, - //ffi::XK_THORN => events::VirtualKeyCode::Thorn, - //ffi::XK_Thorn => events::VirtualKeyCode::Thorn, - //ffi::XK_ssharp => events::VirtualKeyCode::Ssharp, - //ffi::XK_agrave => events::VirtualKeyCode::Agrave, - //ffi::XK_aacute => events::VirtualKeyCode::Aacute, - //ffi::XK_acircumflex => events::VirtualKeyCode::Acircumflex, - //ffi::XK_atilde => events::VirtualKeyCode::Atilde, - //ffi::XK_adiaeresis => events::VirtualKeyCode::Adiaeresis, - //ffi::XK_aring => events::VirtualKeyCode::Aring, - //ffi::XK_ae => events::VirtualKeyCode::Ae, - //ffi::XK_ccedilla => events::VirtualKeyCode::Ccedilla, - //ffi::XK_egrave => events::VirtualKeyCode::Egrave, - //ffi::XK_eacute => events::VirtualKeyCode::Eacute, - //ffi::XK_ecircumflex => events::VirtualKeyCode::Ecircumflex, - //ffi::XK_ediaeresis => events::VirtualKeyCode::Ediaeresis, - //ffi::XK_igrave => events::VirtualKeyCode::Igrave, - //ffi::XK_iacute => events::VirtualKeyCode::Iacute, - //ffi::XK_icircumflex => events::VirtualKeyCode::Icircumflex, - //ffi::XK_idiaeresis => events::VirtualKeyCode::Idiaeresis, - //ffi::XK_eth => events::VirtualKeyCode::Eth, - //ffi::XK_ntilde => events::VirtualKeyCode::Ntilde, - //ffi::XK_ograve => events::VirtualKeyCode::Ograve, - //ffi::XK_oacute => events::VirtualKeyCode::Oacute, - //ffi::XK_ocircumflex => events::VirtualKeyCode::Ocircumflex, - //ffi::XK_otilde => events::VirtualKeyCode::Otilde, - //ffi::XK_odiaeresis => events::VirtualKeyCode::Odiaeresis, - //ffi::XK_division => events::VirtualKeyCode::Division, - //ffi::XK_oslash => events::VirtualKeyCode::Oslash, - //ffi::XK_ugrave => events::VirtualKeyCode::Ugrave, - //ffi::XK_uacute => events::VirtualKeyCode::Uacute, - //ffi::XK_ucircumflex => events::VirtualKeyCode::Ucircumflex, - //ffi::XK_udiaeresis => events::VirtualKeyCode::Udiaeresis, - //ffi::XK_yacute => events::VirtualKeyCode::Yacute, - //ffi::XK_thorn => events::VirtualKeyCode::Thorn, - //ffi::XK_ydiaeresis => events::VirtualKeyCode::Ydiaeresis, - //ffi::XK_Aogonek => events::VirtualKeyCode::Aogonek, - //ffi::XK_breve => events::VirtualKeyCode::Breve, - //ffi::XK_Lstroke => events::VirtualKeyCode::Lstroke, - //ffi::XK_Lcaron => events::VirtualKeyCode::Lcaron, - //ffi::XK_Sacute => events::VirtualKeyCode::Sacute, - //ffi::XK_Scaron => events::VirtualKeyCode::Scaron, - //ffi::XK_Scedilla => events::VirtualKeyCode::Scedilla, - //ffi::XK_Tcaron => events::VirtualKeyCode::Tcaron, - //ffi::XK_Zacute => events::VirtualKeyCode::Zacute, - //ffi::XK_Zcaron => events::VirtualKeyCode::Zcaron, - //ffi::XK_Zabovedot => events::VirtualKeyCode::Zabovedot, - //ffi::XK_aogonek => events::VirtualKeyCode::Aogonek, - //ffi::XK_ogonek => events::VirtualKeyCode::Ogonek, - //ffi::XK_lstroke => events::VirtualKeyCode::Lstroke, - //ffi::XK_lcaron => events::VirtualKeyCode::Lcaron, - //ffi::XK_sacute => events::VirtualKeyCode::Sacute, - //ffi::XK_caron => events::VirtualKeyCode::Caron, - //ffi::XK_scaron => events::VirtualKeyCode::Scaron, - //ffi::XK_scedilla => events::VirtualKeyCode::Scedilla, - //ffi::XK_tcaron => events::VirtualKeyCode::Tcaron, - //ffi::XK_zacute => events::VirtualKeyCode::Zacute, - //ffi::XK_doubleacute => events::VirtualKeyCode::Doubleacute, - //ffi::XK_zcaron => events::VirtualKeyCode::Zcaron, - //ffi::XK_zabovedot => events::VirtualKeyCode::Zabovedot, - //ffi::XK_Racute => events::VirtualKeyCode::Racute, - //ffi::XK_Abreve => events::VirtualKeyCode::Abreve, - //ffi::XK_Lacute => events::VirtualKeyCode::Lacute, - //ffi::XK_Cacute => events::VirtualKeyCode::Cacute, - //ffi::XK_Ccaron => events::VirtualKeyCode::Ccaron, - //ffi::XK_Eogonek => events::VirtualKeyCode::Eogonek, - //ffi::XK_Ecaron => events::VirtualKeyCode::Ecaron, - //ffi::XK_Dcaron => events::VirtualKeyCode::Dcaron, - //ffi::XK_Dstroke => events::VirtualKeyCode::Dstroke, - //ffi::XK_Nacute => events::VirtualKeyCode::Nacute, - //ffi::XK_Ncaron => events::VirtualKeyCode::Ncaron, - //ffi::XK_Odoubleacute => events::VirtualKeyCode::Odoubleacute, - //ffi::XK_Rcaron => events::VirtualKeyCode::Rcaron, - //ffi::XK_Uring => events::VirtualKeyCode::Uring, - //ffi::XK_Udoubleacute => events::VirtualKeyCode::Udoubleacute, - //ffi::XK_Tcedilla => events::VirtualKeyCode::Tcedilla, - //ffi::XK_racute => events::VirtualKeyCode::Racute, - //ffi::XK_abreve => events::VirtualKeyCode::Abreve, - //ffi::XK_lacute => events::VirtualKeyCode::Lacute, - //ffi::XK_cacute => events::VirtualKeyCode::Cacute, - //ffi::XK_ccaron => events::VirtualKeyCode::Ccaron, - //ffi::XK_eogonek => events::VirtualKeyCode::Eogonek, - //ffi::XK_ecaron => events::VirtualKeyCode::Ecaron, - //ffi::XK_dcaron => events::VirtualKeyCode::Dcaron, - //ffi::XK_dstroke => events::VirtualKeyCode::Dstroke, - //ffi::XK_nacute => events::VirtualKeyCode::Nacute, - //ffi::XK_ncaron => events::VirtualKeyCode::Ncaron, - //ffi::XK_odoubleacute => events::VirtualKeyCode::Odoubleacute, - //ffi::XK_udoubleacute => events::VirtualKeyCode::Udoubleacute, - //ffi::XK_rcaron => events::VirtualKeyCode::Rcaron, - //ffi::XK_uring => events::VirtualKeyCode::Uring, - //ffi::XK_tcedilla => events::VirtualKeyCode::Tcedilla, - //ffi::XK_abovedot => events::VirtualKeyCode::Abovedot, - //ffi::XK_Hstroke => events::VirtualKeyCode::Hstroke, - //ffi::XK_Hcircumflex => events::VirtualKeyCode::Hcircumflex, - //ffi::XK_Iabovedot => events::VirtualKeyCode::Iabovedot, - //ffi::XK_Gbreve => events::VirtualKeyCode::Gbreve, - //ffi::XK_Jcircumflex => events::VirtualKeyCode::Jcircumflex, - //ffi::XK_hstroke => events::VirtualKeyCode::Hstroke, - //ffi::XK_hcircumflex => events::VirtualKeyCode::Hcircumflex, - //ffi::XK_idotless => events::VirtualKeyCode::Idotless, - //ffi::XK_gbreve => events::VirtualKeyCode::Gbreve, - //ffi::XK_jcircumflex => events::VirtualKeyCode::Jcircumflex, - //ffi::XK_Cabovedot => events::VirtualKeyCode::Cabovedot, - //ffi::XK_Ccircumflex => events::VirtualKeyCode::Ccircumflex, - //ffi::XK_Gabovedot => events::VirtualKeyCode::Gabovedot, - //ffi::XK_Gcircumflex => events::VirtualKeyCode::Gcircumflex, - //ffi::XK_Ubreve => events::VirtualKeyCode::Ubreve, - //ffi::XK_Scircumflex => events::VirtualKeyCode::Scircumflex, - //ffi::XK_cabovedot => events::VirtualKeyCode::Cabovedot, - //ffi::XK_ccircumflex => events::VirtualKeyCode::Ccircumflex, - //ffi::XK_gabovedot => events::VirtualKeyCode::Gabovedot, - //ffi::XK_gcircumflex => events::VirtualKeyCode::Gcircumflex, - //ffi::XK_ubreve => events::VirtualKeyCode::Ubreve, - //ffi::XK_scircumflex => events::VirtualKeyCode::Scircumflex, - //ffi::XK_kra => events::VirtualKeyCode::Kra, - //ffi::XK_kappa => events::VirtualKeyCode::Kappa, - //ffi::XK_Rcedilla => events::VirtualKeyCode::Rcedilla, - //ffi::XK_Itilde => events::VirtualKeyCode::Itilde, - //ffi::XK_Lcedilla => events::VirtualKeyCode::Lcedilla, - //ffi::XK_Emacron => events::VirtualKeyCode::Emacron, - //ffi::XK_Gcedilla => events::VirtualKeyCode::Gcedilla, - //ffi::XK_Tslash => events::VirtualKeyCode::Tslash, - //ffi::XK_rcedilla => events::VirtualKeyCode::Rcedilla, - //ffi::XK_itilde => events::VirtualKeyCode::Itilde, - //ffi::XK_lcedilla => events::VirtualKeyCode::Lcedilla, - //ffi::XK_emacron => events::VirtualKeyCode::Emacron, - //ffi::XK_gcedilla => events::VirtualKeyCode::Gcedilla, - //ffi::XK_tslash => events::VirtualKeyCode::Tslash, - //ffi::XK_ENG => events::VirtualKeyCode::Eng, - //ffi::XK_eng => events::VirtualKeyCode::Eng, - //ffi::XK_Amacron => events::VirtualKeyCode::Amacron, - //ffi::XK_Iogonek => events::VirtualKeyCode::Iogonek, - //ffi::XK_Eabovedot => events::VirtualKeyCode::Eabovedot, - //ffi::XK_Imacron => events::VirtualKeyCode::Imacron, - //ffi::XK_Ncedilla => events::VirtualKeyCode::Ncedilla, - //ffi::XK_Omacron => events::VirtualKeyCode::Omacron, - //ffi::XK_Kcedilla => events::VirtualKeyCode::Kcedilla, - //ffi::XK_Uogonek => events::VirtualKeyCode::Uogonek, - //ffi::XK_Utilde => events::VirtualKeyCode::Utilde, - //ffi::XK_Umacron => events::VirtualKeyCode::Umacron, - //ffi::XK_amacron => events::VirtualKeyCode::Amacron, - //ffi::XK_iogonek => events::VirtualKeyCode::Iogonek, - //ffi::XK_eabovedot => events::VirtualKeyCode::Eabovedot, - //ffi::XK_imacron => events::VirtualKeyCode::Imacron, - //ffi::XK_ncedilla => events::VirtualKeyCode::Ncedilla, - //ffi::XK_omacron => events::VirtualKeyCode::Omacron, - //ffi::XK_kcedilla => events::VirtualKeyCode::Kcedilla, - //ffi::XK_uogonek => events::VirtualKeyCode::Uogonek, - //ffi::XK_utilde => events::VirtualKeyCode::Utilde, - //ffi::XK_umacron => events::VirtualKeyCode::Umacron, - //ffi::XK_overline => events::VirtualKeyCode::Overline, - //ffi::XK_kana_fullstop => events::VirtualKeyCode::Kana_fullstop, - //ffi::XK_kana_openingbracket => events::VirtualKeyCode::Kana_openingbracket, - //ffi::XK_kana_closingbracket => events::VirtualKeyCode::Kana_closingbracket, - //ffi::XK_kana_comma => events::VirtualKeyCode::Kana_comma, - //ffi::XK_kana_conjunctive => events::VirtualKeyCode::Kana_conjunctive, - //ffi::XK_kana_middledot => events::VirtualKeyCode::Kana_middledot, - //ffi::XK_kana_WO => events::VirtualKeyCode::Kana_wo, - //ffi::XK_kana_a => events::VirtualKeyCode::Kana_a, - //ffi::XK_kana_i => events::VirtualKeyCode::Kana_i, - //ffi::XK_kana_u => events::VirtualKeyCode::Kana_u, - //ffi::XK_kana_e => events::VirtualKeyCode::Kana_e, - //ffi::XK_kana_o => events::VirtualKeyCode::Kana_o, - //ffi::XK_kana_ya => events::VirtualKeyCode::Kana_ya, - //ffi::XK_kana_yu => events::VirtualKeyCode::Kana_yu, - //ffi::XK_kana_yo => events::VirtualKeyCode::Kana_yo, - //ffi::XK_kana_tsu => events::VirtualKeyCode::Kana_tsu, - //ffi::XK_kana_tu => events::VirtualKeyCode::Kana_tu, - //ffi::XK_prolongedsound => events::VirtualKeyCode::Prolongedsound, - //ffi::XK_kana_A => events::VirtualKeyCode::Kana_a, - //ffi::XK_kana_I => events::VirtualKeyCode::Kana_i, - //ffi::XK_kana_U => events::VirtualKeyCode::Kana_u, - //ffi::XK_kana_E => events::VirtualKeyCode::Kana_e, - //ffi::XK_kana_O => events::VirtualKeyCode::Kana_o, - //ffi::XK_kana_KA => events::VirtualKeyCode::Kana_ka, - //ffi::XK_kana_KI => events::VirtualKeyCode::Kana_ki, - //ffi::XK_kana_KU => events::VirtualKeyCode::Kana_ku, - //ffi::XK_kana_KE => events::VirtualKeyCode::Kana_ke, - //ffi::XK_kana_KO => events::VirtualKeyCode::Kana_ko, - //ffi::XK_kana_SA => events::VirtualKeyCode::Kana_sa, - //ffi::XK_kana_SHI => events::VirtualKeyCode::Kana_shi, - //ffi::XK_kana_SU => events::VirtualKeyCode::Kana_su, - //ffi::XK_kana_SE => events::VirtualKeyCode::Kana_se, - //ffi::XK_kana_SO => events::VirtualKeyCode::Kana_so, - //ffi::XK_kana_TA => events::VirtualKeyCode::Kana_ta, - //ffi::XK_kana_CHI => events::VirtualKeyCode::Kana_chi, - //ffi::XK_kana_TI => events::VirtualKeyCode::Kana_ti, - //ffi::XK_kana_TSU => events::VirtualKeyCode::Kana_tsu, - //ffi::XK_kana_TU => events::VirtualKeyCode::Kana_tu, - //ffi::XK_kana_TE => events::VirtualKeyCode::Kana_te, - //ffi::XK_kana_TO => events::VirtualKeyCode::Kana_to, - //ffi::XK_kana_NA => events::VirtualKeyCode::Kana_na, - //ffi::XK_kana_NI => events::VirtualKeyCode::Kana_ni, - //ffi::XK_kana_NU => events::VirtualKeyCode::Kana_nu, - //ffi::XK_kana_NE => events::VirtualKeyCode::Kana_ne, - //ffi::XK_kana_NO => events::VirtualKeyCode::Kana_no, - //ffi::XK_kana_HA => events::VirtualKeyCode::Kana_ha, - //ffi::XK_kana_HI => events::VirtualKeyCode::Kana_hi, - //ffi::XK_kana_FU => events::VirtualKeyCode::Kana_fu, - //ffi::XK_kana_HU => events::VirtualKeyCode::Kana_hu, - //ffi::XK_kana_HE => events::VirtualKeyCode::Kana_he, - //ffi::XK_kana_HO => events::VirtualKeyCode::Kana_ho, - //ffi::XK_kana_MA => events::VirtualKeyCode::Kana_ma, - //ffi::XK_kana_MI => events::VirtualKeyCode::Kana_mi, - //ffi::XK_kana_MU => events::VirtualKeyCode::Kana_mu, - //ffi::XK_kana_ME => events::VirtualKeyCode::Kana_me, - //ffi::XK_kana_MO => events::VirtualKeyCode::Kana_mo, - //ffi::XK_kana_YA => events::VirtualKeyCode::Kana_ya, - //ffi::XK_kana_YU => events::VirtualKeyCode::Kana_yu, - //ffi::XK_kana_YO => events::VirtualKeyCode::Kana_yo, - //ffi::XK_kana_RA => events::VirtualKeyCode::Kana_ra, - //ffi::XK_kana_RI => events::VirtualKeyCode::Kana_ri, - //ffi::XK_kana_RU => events::VirtualKeyCode::Kana_ru, - //ffi::XK_kana_RE => events::VirtualKeyCode::Kana_re, - //ffi::XK_kana_RO => events::VirtualKeyCode::Kana_ro, - //ffi::XK_kana_WA => events::VirtualKeyCode::Kana_wa, - //ffi::XK_kana_N => events::VirtualKeyCode::Kana_n, - //ffi::XK_voicedsound => events::VirtualKeyCode::Voicedsound, - //ffi::XK_semivoicedsound => events::VirtualKeyCode::Semivoicedsound, - //ffi::XK_kana_switch => events::VirtualKeyCode::Kana_switch, - //ffi::XK_Arabic_comma => events::VirtualKeyCode::Arabic_comma, - //ffi::XK_Arabic_semicolon => events::VirtualKeyCode::Arabic_semicolon, - //ffi::XK_Arabic_question_mark => events::VirtualKeyCode::Arabic_question_mark, - //ffi::XK_Arabic_hamza => events::VirtualKeyCode::Arabic_hamza, - //ffi::XK_Arabic_maddaonalef => events::VirtualKeyCode::Arabic_maddaonalef, - //ffi::XK_Arabic_hamzaonalef => events::VirtualKeyCode::Arabic_hamzaonalef, - //ffi::XK_Arabic_hamzaonwaw => events::VirtualKeyCode::Arabic_hamzaonwaw, - //ffi::XK_Arabic_hamzaunderalef => events::VirtualKeyCode::Arabic_hamzaunderalef, - //ffi::XK_Arabic_hamzaonyeh => events::VirtualKeyCode::Arabic_hamzaonyeh, - //ffi::XK_Arabic_alef => events::VirtualKeyCode::Arabic_alef, - //ffi::XK_Arabic_beh => events::VirtualKeyCode::Arabic_beh, - //ffi::XK_Arabic_tehmarbuta => events::VirtualKeyCode::Arabic_tehmarbuta, - //ffi::XK_Arabic_teh => events::VirtualKeyCode::Arabic_teh, - //ffi::XK_Arabic_theh => events::VirtualKeyCode::Arabic_theh, - //ffi::XK_Arabic_jeem => events::VirtualKeyCode::Arabic_jeem, - //ffi::XK_Arabic_hah => events::VirtualKeyCode::Arabic_hah, - //ffi::XK_Arabic_khah => events::VirtualKeyCode::Arabic_khah, - //ffi::XK_Arabic_dal => events::VirtualKeyCode::Arabic_dal, - //ffi::XK_Arabic_thal => events::VirtualKeyCode::Arabic_thal, - //ffi::XK_Arabic_ra => events::VirtualKeyCode::Arabic_ra, - //ffi::XK_Arabic_zain => events::VirtualKeyCode::Arabic_zain, - //ffi::XK_Arabic_seen => events::VirtualKeyCode::Arabic_seen, - //ffi::XK_Arabic_sheen => events::VirtualKeyCode::Arabic_sheen, - //ffi::XK_Arabic_sad => events::VirtualKeyCode::Arabic_sad, - //ffi::XK_Arabic_dad => events::VirtualKeyCode::Arabic_dad, - //ffi::XK_Arabic_tah => events::VirtualKeyCode::Arabic_tah, - //ffi::XK_Arabic_zah => events::VirtualKeyCode::Arabic_zah, - //ffi::XK_Arabic_ain => events::VirtualKeyCode::Arabic_ain, - //ffi::XK_Arabic_ghain => events::VirtualKeyCode::Arabic_ghain, - //ffi::XK_Arabic_tatweel => events::VirtualKeyCode::Arabic_tatweel, - //ffi::XK_Arabic_feh => events::VirtualKeyCode::Arabic_feh, - //ffi::XK_Arabic_qaf => events::VirtualKeyCode::Arabic_qaf, - //ffi::XK_Arabic_kaf => events::VirtualKeyCode::Arabic_kaf, - //ffi::XK_Arabic_lam => events::VirtualKeyCode::Arabic_lam, - //ffi::XK_Arabic_meem => events::VirtualKeyCode::Arabic_meem, - //ffi::XK_Arabic_noon => events::VirtualKeyCode::Arabic_noon, - //ffi::XK_Arabic_ha => events::VirtualKeyCode::Arabic_ha, - //ffi::XK_Arabic_heh => events::VirtualKeyCode::Arabic_heh, - //ffi::XK_Arabic_waw => events::VirtualKeyCode::Arabic_waw, - //ffi::XK_Arabic_alefmaksura => events::VirtualKeyCode::Arabic_alefmaksura, - //ffi::XK_Arabic_yeh => events::VirtualKeyCode::Arabic_yeh, - //ffi::XK_Arabic_fathatan => events::VirtualKeyCode::Arabic_fathatan, - //ffi::XK_Arabic_dammatan => events::VirtualKeyCode::Arabic_dammatan, - //ffi::XK_Arabic_kasratan => events::VirtualKeyCode::Arabic_kasratan, - //ffi::XK_Arabic_fatha => events::VirtualKeyCode::Arabic_fatha, - //ffi::XK_Arabic_damma => events::VirtualKeyCode::Arabic_damma, - //ffi::XK_Arabic_kasra => events::VirtualKeyCode::Arabic_kasra, - //ffi::XK_Arabic_shadda => events::VirtualKeyCode::Arabic_shadda, - //ffi::XK_Arabic_sukun => events::VirtualKeyCode::Arabic_sukun, - //ffi::XK_Arabic_switch => events::VirtualKeyCode::Arabic_switch, - //ffi::XK_Serbian_dje => events::VirtualKeyCode::Serbian_dje, - //ffi::XK_Macedonia_gje => events::VirtualKeyCode::Macedonia_gje, - //ffi::XK_Cyrillic_io => events::VirtualKeyCode::Cyrillic_io, - //ffi::XK_Ukrainian_ie => events::VirtualKeyCode::Ukrainian_ie, - //ffi::XK_Ukranian_je => events::VirtualKeyCode::Ukranian_je, - //ffi::XK_Macedonia_dse => events::VirtualKeyCode::Macedonia_dse, - //ffi::XK_Ukrainian_i => events::VirtualKeyCode::Ukrainian_i, - //ffi::XK_Ukranian_i => events::VirtualKeyCode::Ukranian_i, - //ffi::XK_Ukrainian_yi => events::VirtualKeyCode::Ukrainian_yi, - //ffi::XK_Ukranian_yi => events::VirtualKeyCode::Ukranian_yi, - //ffi::XK_Cyrillic_je => events::VirtualKeyCode::Cyrillic_je, - //ffi::XK_Serbian_je => events::VirtualKeyCode::Serbian_je, - //ffi::XK_Cyrillic_lje => events::VirtualKeyCode::Cyrillic_lje, - //ffi::XK_Serbian_lje => events::VirtualKeyCode::Serbian_lje, - //ffi::XK_Cyrillic_nje => events::VirtualKeyCode::Cyrillic_nje, - //ffi::XK_Serbian_nje => events::VirtualKeyCode::Serbian_nje, - //ffi::XK_Serbian_tshe => events::VirtualKeyCode::Serbian_tshe, - //ffi::XK_Macedonia_kje => events::VirtualKeyCode::Macedonia_kje, - //ffi::XK_Byelorussian_shortu => events::VirtualKeyCode::Byelorussian_shortu, - //ffi::XK_Cyrillic_dzhe => events::VirtualKeyCode::Cyrillic_dzhe, - //ffi::XK_Serbian_dze => events::VirtualKeyCode::Serbian_dze, - //ffi::XK_numerosign => events::VirtualKeyCode::Numerosign, - //ffi::XK_Serbian_DJE => events::VirtualKeyCode::Serbian_dje, - //ffi::XK_Macedonia_GJE => events::VirtualKeyCode::Macedonia_gje, - //ffi::XK_Cyrillic_IO => events::VirtualKeyCode::Cyrillic_io, - //ffi::XK_Ukrainian_IE => events::VirtualKeyCode::Ukrainian_ie, - //ffi::XK_Ukranian_JE => events::VirtualKeyCode::Ukranian_je, - //ffi::XK_Macedonia_DSE => events::VirtualKeyCode::Macedonia_dse, - //ffi::XK_Ukrainian_I => events::VirtualKeyCode::Ukrainian_i, - //ffi::XK_Ukranian_I => events::VirtualKeyCode::Ukranian_i, - //ffi::XK_Ukrainian_YI => events::VirtualKeyCode::Ukrainian_yi, - //ffi::XK_Ukranian_YI => events::VirtualKeyCode::Ukranian_yi, - //ffi::XK_Cyrillic_JE => events::VirtualKeyCode::Cyrillic_je, - //ffi::XK_Serbian_JE => events::VirtualKeyCode::Serbian_je, - //ffi::XK_Cyrillic_LJE => events::VirtualKeyCode::Cyrillic_lje, - //ffi::XK_Serbian_LJE => events::VirtualKeyCode::Serbian_lje, - //ffi::XK_Cyrillic_NJE => events::VirtualKeyCode::Cyrillic_nje, - //ffi::XK_Serbian_NJE => events::VirtualKeyCode::Serbian_nje, - //ffi::XK_Serbian_TSHE => events::VirtualKeyCode::Serbian_tshe, - //ffi::XK_Macedonia_KJE => events::VirtualKeyCode::Macedonia_kje, - //ffi::XK_Byelorussian_SHORTU => events::VirtualKeyCode::Byelorussian_shortu, - //ffi::XK_Cyrillic_DZHE => events::VirtualKeyCode::Cyrillic_dzhe, - //ffi::XK_Serbian_DZE => events::VirtualKeyCode::Serbian_dze, - //ffi::XK_Cyrillic_yu => events::VirtualKeyCode::Cyrillic_yu, - //ffi::XK_Cyrillic_a => events::VirtualKeyCode::Cyrillic_a, - //ffi::XK_Cyrillic_be => events::VirtualKeyCode::Cyrillic_be, - //ffi::XK_Cyrillic_tse => events::VirtualKeyCode::Cyrillic_tse, - //ffi::XK_Cyrillic_de => events::VirtualKeyCode::Cyrillic_de, - //ffi::XK_Cyrillic_ie => events::VirtualKeyCode::Cyrillic_ie, - //ffi::XK_Cyrillic_ef => events::VirtualKeyCode::Cyrillic_ef, - //ffi::XK_Cyrillic_ghe => events::VirtualKeyCode::Cyrillic_ghe, - //ffi::XK_Cyrillic_ha => events::VirtualKeyCode::Cyrillic_ha, - //ffi::XK_Cyrillic_i => events::VirtualKeyCode::Cyrillic_i, - //ffi::XK_Cyrillic_shorti => events::VirtualKeyCode::Cyrillic_shorti, - //ffi::XK_Cyrillic_ka => events::VirtualKeyCode::Cyrillic_ka, - //ffi::XK_Cyrillic_el => events::VirtualKeyCode::Cyrillic_el, - //ffi::XK_Cyrillic_em => events::VirtualKeyCode::Cyrillic_em, - //ffi::XK_Cyrillic_en => events::VirtualKeyCode::Cyrillic_en, - //ffi::XK_Cyrillic_o => events::VirtualKeyCode::Cyrillic_o, - //ffi::XK_Cyrillic_pe => events::VirtualKeyCode::Cyrillic_pe, - //ffi::XK_Cyrillic_ya => events::VirtualKeyCode::Cyrillic_ya, - //ffi::XK_Cyrillic_er => events::VirtualKeyCode::Cyrillic_er, - //ffi::XK_Cyrillic_es => events::VirtualKeyCode::Cyrillic_es, - //ffi::XK_Cyrillic_te => events::VirtualKeyCode::Cyrillic_te, - //ffi::XK_Cyrillic_u => events::VirtualKeyCode::Cyrillic_u, - //ffi::XK_Cyrillic_zhe => events::VirtualKeyCode::Cyrillic_zhe, - //ffi::XK_Cyrillic_ve => events::VirtualKeyCode::Cyrillic_ve, - //ffi::XK_Cyrillic_softsign => events::VirtualKeyCode::Cyrillic_softsign, - //ffi::XK_Cyrillic_yeru => events::VirtualKeyCode::Cyrillic_yeru, - //ffi::XK_Cyrillic_ze => events::VirtualKeyCode::Cyrillic_ze, - //ffi::XK_Cyrillic_sha => events::VirtualKeyCode::Cyrillic_sha, - //ffi::XK_Cyrillic_e => events::VirtualKeyCode::Cyrillic_e, - //ffi::XK_Cyrillic_shcha => events::VirtualKeyCode::Cyrillic_shcha, - //ffi::XK_Cyrillic_che => events::VirtualKeyCode::Cyrillic_che, - //ffi::XK_Cyrillic_hardsign => events::VirtualKeyCode::Cyrillic_hardsign, - //ffi::XK_Cyrillic_YU => events::VirtualKeyCode::Cyrillic_yu, - //ffi::XK_Cyrillic_A => events::VirtualKeyCode::Cyrillic_a, - //ffi::XK_Cyrillic_BE => events::VirtualKeyCode::Cyrillic_be, - //ffi::XK_Cyrillic_TSE => events::VirtualKeyCode::Cyrillic_tse, - //ffi::XK_Cyrillic_DE => events::VirtualKeyCode::Cyrillic_de, - //ffi::XK_Cyrillic_IE => events::VirtualKeyCode::Cyrillic_ie, - //ffi::XK_Cyrillic_EF => events::VirtualKeyCode::Cyrillic_ef, - //ffi::XK_Cyrillic_GHE => events::VirtualKeyCode::Cyrillic_ghe, - //ffi::XK_Cyrillic_HA => events::VirtualKeyCode::Cyrillic_ha, - //ffi::XK_Cyrillic_I => events::VirtualKeyCode::Cyrillic_i, - //ffi::XK_Cyrillic_SHORTI => events::VirtualKeyCode::Cyrillic_shorti, - //ffi::XK_Cyrillic_KA => events::VirtualKeyCode::Cyrillic_ka, - //ffi::XK_Cyrillic_EL => events::VirtualKeyCode::Cyrillic_el, - //ffi::XK_Cyrillic_EM => events::VirtualKeyCode::Cyrillic_em, - //ffi::XK_Cyrillic_EN => events::VirtualKeyCode::Cyrillic_en, - //ffi::XK_Cyrillic_O => events::VirtualKeyCode::Cyrillic_o, - //ffi::XK_Cyrillic_PE => events::VirtualKeyCode::Cyrillic_pe, - //ffi::XK_Cyrillic_YA => events::VirtualKeyCode::Cyrillic_ya, - //ffi::XK_Cyrillic_ER => events::VirtualKeyCode::Cyrillic_er, - //ffi::XK_Cyrillic_ES => events::VirtualKeyCode::Cyrillic_es, - //ffi::XK_Cyrillic_TE => events::VirtualKeyCode::Cyrillic_te, - //ffi::XK_Cyrillic_U => events::VirtualKeyCode::Cyrillic_u, - //ffi::XK_Cyrillic_ZHE => events::VirtualKeyCode::Cyrillic_zhe, - //ffi::XK_Cyrillic_VE => events::VirtualKeyCode::Cyrillic_ve, - //ffi::XK_Cyrillic_SOFTSIGN => events::VirtualKeyCode::Cyrillic_softsign, - //ffi::XK_Cyrillic_YERU => events::VirtualKeyCode::Cyrillic_yeru, - //ffi::XK_Cyrillic_ZE => events::VirtualKeyCode::Cyrillic_ze, - //ffi::XK_Cyrillic_SHA => events::VirtualKeyCode::Cyrillic_sha, - //ffi::XK_Cyrillic_E => events::VirtualKeyCode::Cyrillic_e, - //ffi::XK_Cyrillic_SHCHA => events::VirtualKeyCode::Cyrillic_shcha, - //ffi::XK_Cyrillic_CHE => events::VirtualKeyCode::Cyrillic_che, - //ffi::XK_Cyrillic_HARDSIGN => events::VirtualKeyCode::Cyrillic_hardsign, - //ffi::XK_Greek_ALPHAaccent => events::VirtualKeyCode::Greek_alphaaccent, - //ffi::XK_Greek_EPSILONaccent => events::VirtualKeyCode::Greek_epsilonaccent, - //ffi::XK_Greek_ETAaccent => events::VirtualKeyCode::Greek_etaaccent, - //ffi::XK_Greek_IOTAaccent => events::VirtualKeyCode::Greek_iotaaccent, - //ffi::XK_Greek_IOTAdiaeresis => events::VirtualKeyCode::Greek_iotadiaeresis, - //ffi::XK_Greek_OMICRONaccent => events::VirtualKeyCode::Greek_omicronaccent, - //ffi::XK_Greek_UPSILONaccent => events::VirtualKeyCode::Greek_upsilonaccent, - //ffi::XK_Greek_UPSILONdieresis => events::VirtualKeyCode::Greek_upsilondieresis, - //ffi::XK_Greek_OMEGAaccent => events::VirtualKeyCode::Greek_omegaaccent, - //ffi::XK_Greek_accentdieresis => events::VirtualKeyCode::Greek_accentdieresis, - //ffi::XK_Greek_horizbar => events::VirtualKeyCode::Greek_horizbar, - //ffi::XK_Greek_alphaaccent => events::VirtualKeyCode::Greek_alphaaccent, - //ffi::XK_Greek_epsilonaccent => events::VirtualKeyCode::Greek_epsilonaccent, - //ffi::XK_Greek_etaaccent => events::VirtualKeyCode::Greek_etaaccent, - //ffi::XK_Greek_iotaaccent => events::VirtualKeyCode::Greek_iotaaccent, - //ffi::XK_Greek_iotadieresis => events::VirtualKeyCode::Greek_iotadieresis, - //ffi::XK_Greek_iotaaccentdieresis => events::VirtualKeyCode::Greek_iotaaccentdieresis, - //ffi::XK_Greek_omicronaccent => events::VirtualKeyCode::Greek_omicronaccent, - //ffi::XK_Greek_upsilonaccent => events::VirtualKeyCode::Greek_upsilonaccent, - //ffi::XK_Greek_upsilondieresis => events::VirtualKeyCode::Greek_upsilondieresis, - //ffi::XK_Greek_upsilonaccentdieresis => events::VirtualKeyCode::Greek_upsilonaccentdieresis, - //ffi::XK_Greek_omegaaccent => events::VirtualKeyCode::Greek_omegaaccent, - //ffi::XK_Greek_ALPHA => events::VirtualKeyCode::Greek_alpha, - //ffi::XK_Greek_BETA => events::VirtualKeyCode::Greek_beta, - //ffi::XK_Greek_GAMMA => events::VirtualKeyCode::Greek_gamma, - //ffi::XK_Greek_DELTA => events::VirtualKeyCode::Greek_delta, - //ffi::XK_Greek_EPSILON => events::VirtualKeyCode::Greek_epsilon, - //ffi::XK_Greek_ZETA => events::VirtualKeyCode::Greek_zeta, - //ffi::XK_Greek_ETA => events::VirtualKeyCode::Greek_eta, - //ffi::XK_Greek_THETA => events::VirtualKeyCode::Greek_theta, - //ffi::XK_Greek_IOTA => events::VirtualKeyCode::Greek_iota, - //ffi::XK_Greek_KAPPA => events::VirtualKeyCode::Greek_kappa, - //ffi::XK_Greek_LAMDA => events::VirtualKeyCode::Greek_lamda, - //ffi::XK_Greek_LAMBDA => events::VirtualKeyCode::Greek_lambda, - //ffi::XK_Greek_MU => events::VirtualKeyCode::Greek_mu, - //ffi::XK_Greek_NU => events::VirtualKeyCode::Greek_nu, - //ffi::XK_Greek_XI => events::VirtualKeyCode::Greek_xi, - //ffi::XK_Greek_OMICRON => events::VirtualKeyCode::Greek_omicron, - //ffi::XK_Greek_PI => events::VirtualKeyCode::Greek_pi, - //ffi::XK_Greek_RHO => events::VirtualKeyCode::Greek_rho, - //ffi::XK_Greek_SIGMA => events::VirtualKeyCode::Greek_sigma, - //ffi::XK_Greek_TAU => events::VirtualKeyCode::Greek_tau, - //ffi::XK_Greek_UPSILON => events::VirtualKeyCode::Greek_upsilon, - //ffi::XK_Greek_PHI => events::VirtualKeyCode::Greek_phi, - //ffi::XK_Greek_CHI => events::VirtualKeyCode::Greek_chi, - //ffi::XK_Greek_PSI => events::VirtualKeyCode::Greek_psi, - //ffi::XK_Greek_OMEGA => events::VirtualKeyCode::Greek_omega, - //ffi::XK_Greek_alpha => events::VirtualKeyCode::Greek_alpha, - //ffi::XK_Greek_beta => events::VirtualKeyCode::Greek_beta, - //ffi::XK_Greek_gamma => events::VirtualKeyCode::Greek_gamma, - //ffi::XK_Greek_delta => events::VirtualKeyCode::Greek_delta, - //ffi::XK_Greek_epsilon => events::VirtualKeyCode::Greek_epsilon, - //ffi::XK_Greek_zeta => events::VirtualKeyCode::Greek_zeta, - //ffi::XK_Greek_eta => events::VirtualKeyCode::Greek_eta, - //ffi::XK_Greek_theta => events::VirtualKeyCode::Greek_theta, - //ffi::XK_Greek_iota => events::VirtualKeyCode::Greek_iota, - //ffi::XK_Greek_kappa => events::VirtualKeyCode::Greek_kappa, - //ffi::XK_Greek_lamda => events::VirtualKeyCode::Greek_lamda, - //ffi::XK_Greek_lambda => events::VirtualKeyCode::Greek_lambda, - //ffi::XK_Greek_mu => events::VirtualKeyCode::Greek_mu, - //ffi::XK_Greek_nu => events::VirtualKeyCode::Greek_nu, - //ffi::XK_Greek_xi => events::VirtualKeyCode::Greek_xi, - //ffi::XK_Greek_omicron => events::VirtualKeyCode::Greek_omicron, - //ffi::XK_Greek_pi => events::VirtualKeyCode::Greek_pi, - //ffi::XK_Greek_rho => events::VirtualKeyCode::Greek_rho, - //ffi::XK_Greek_sigma => events::VirtualKeyCode::Greek_sigma, - //ffi::XK_Greek_finalsmallsigma => events::VirtualKeyCode::Greek_finalsmallsigma, - //ffi::XK_Greek_tau => events::VirtualKeyCode::Greek_tau, - //ffi::XK_Greek_upsilon => events::VirtualKeyCode::Greek_upsilon, - //ffi::XK_Greek_phi => events::VirtualKeyCode::Greek_phi, - //ffi::XK_Greek_chi => events::VirtualKeyCode::Greek_chi, - //ffi::XK_Greek_psi => events::VirtualKeyCode::Greek_psi, - //ffi::XK_Greek_omega => events::VirtualKeyCode::Greek_omega, - //ffi::XK_Greek_switch => events::VirtualKeyCode::Greek_switch, - //ffi::XK_leftradical => events::VirtualKeyCode::Leftradical, - //ffi::XK_topleftradical => events::VirtualKeyCode::Topleftradical, - //ffi::XK_horizconnector => events::VirtualKeyCode::Horizconnector, - //ffi::XK_topintegral => events::VirtualKeyCode::Topintegral, - //ffi::XK_botintegral => events::VirtualKeyCode::Botintegral, - //ffi::XK_vertconnector => events::VirtualKeyCode::Vertconnector, - //ffi::XK_topleftsqbracket => events::VirtualKeyCode::Topleftsqbracket, - //ffi::XK_botleftsqbracket => events::VirtualKeyCode::Botleftsqbracket, - //ffi::XK_toprightsqbracket => events::VirtualKeyCode::Toprightsqbracket, - //ffi::XK_botrightsqbracket => events::VirtualKeyCode::Botrightsqbracket, - //ffi::XK_topleftparens => events::VirtualKeyCode::Topleftparens, - //ffi::XK_botleftparens => events::VirtualKeyCode::Botleftparens, - //ffi::XK_toprightparens => events::VirtualKeyCode::Toprightparens, - //ffi::XK_botrightparens => events::VirtualKeyCode::Botrightparens, - //ffi::XK_leftmiddlecurlybrace => events::VirtualKeyCode::Leftmiddlecurlybrace, - //ffi::XK_rightmiddlecurlybrace => events::VirtualKeyCode::Rightmiddlecurlybrace, - //ffi::XK_topleftsummation => events::VirtualKeyCode::Topleftsummation, - //ffi::XK_botleftsummation => events::VirtualKeyCode::Botleftsummation, - //ffi::XK_topvertsummationconnector => events::VirtualKeyCode::Topvertsummationconnector, - //ffi::XK_botvertsummationconnector => events::VirtualKeyCode::Botvertsummationconnector, - //ffi::XK_toprightsummation => events::VirtualKeyCode::Toprightsummation, - //ffi::XK_botrightsummation => events::VirtualKeyCode::Botrightsummation, - //ffi::XK_rightmiddlesummation => events::VirtualKeyCode::Rightmiddlesummation, - //ffi::XK_lessthanequal => events::VirtualKeyCode::Lessthanequal, - //ffi::XK_notequal => events::VirtualKeyCode::Notequal, - //ffi::XK_greaterthanequal => events::VirtualKeyCode::Greaterthanequal, - //ffi::XK_integral => events::VirtualKeyCode::Integral, - //ffi::XK_therefore => events::VirtualKeyCode::Therefore, - //ffi::XK_variation => events::VirtualKeyCode::Variation, - //ffi::XK_infinity => events::VirtualKeyCode::Infinity, - //ffi::XK_nabla => events::VirtualKeyCode::Nabla, - //ffi::XK_approximate => events::VirtualKeyCode::Approximate, - //ffi::XK_similarequal => events::VirtualKeyCode::Similarequal, - //ffi::XK_ifonlyif => events::VirtualKeyCode::Ifonlyif, - //ffi::XK_implies => events::VirtualKeyCode::Implies, - //ffi::XK_identical => events::VirtualKeyCode::Identical, - //ffi::XK_radical => events::VirtualKeyCode::Radical, - //ffi::XK_includedin => events::VirtualKeyCode::Includedin, - //ffi::XK_includes => events::VirtualKeyCode::Includes, - //ffi::XK_intersection => events::VirtualKeyCode::Intersection, - //ffi::XK_union => events::VirtualKeyCode::Union, - //ffi::XK_logicaland => events::VirtualKeyCode::Logicaland, - //ffi::XK_logicalor => events::VirtualKeyCode::Logicalor, - //ffi::XK_partialderivative => events::VirtualKeyCode::Partialderivative, - //ffi::XK_function => events::VirtualKeyCode::Function, - //ffi::XK_leftarrow => events::VirtualKeyCode::Leftarrow, - //ffi::XK_uparrow => events::VirtualKeyCode::Uparrow, - //ffi::XK_rightarrow => events::VirtualKeyCode::Rightarrow, - //ffi::XK_downarrow => events::VirtualKeyCode::Downarrow, - //ffi::XK_blank => events::VirtualKeyCode::Blank, - //ffi::XK_soliddiamond => events::VirtualKeyCode::Soliddiamond, - //ffi::XK_checkerboard => events::VirtualKeyCode::Checkerboard, - //ffi::XK_ht => events::VirtualKeyCode::Ht, - //ffi::XK_ff => events::VirtualKeyCode::Ff, - //ffi::XK_cr => events::VirtualKeyCode::Cr, - //ffi::XK_lf => events::VirtualKeyCode::Lf, - //ffi::XK_nl => events::VirtualKeyCode::Nl, - //ffi::XK_vt => events::VirtualKeyCode::Vt, - //ffi::XK_lowrightcorner => events::VirtualKeyCode::Lowrightcorner, - //ffi::XK_uprightcorner => events::VirtualKeyCode::Uprightcorner, - //ffi::XK_upleftcorner => events::VirtualKeyCode::Upleftcorner, - //ffi::XK_lowleftcorner => events::VirtualKeyCode::Lowleftcorner, - //ffi::XK_crossinglines => events::VirtualKeyCode::Crossinglines, - //ffi::XK_horizlinescan1 => events::VirtualKeyCode::Horizlinescan1, - //ffi::XK_horizlinescan3 => events::VirtualKeyCode::Horizlinescan3, - //ffi::XK_horizlinescan5 => events::VirtualKeyCode::Horizlinescan5, - //ffi::XK_horizlinescan7 => events::VirtualKeyCode::Horizlinescan7, - //ffi::XK_horizlinescan9 => events::VirtualKeyCode::Horizlinescan9, - //ffi::XK_leftt => events::VirtualKeyCode::Leftt, - //ffi::XK_rightt => events::VirtualKeyCode::Rightt, - //ffi::XK_bott => events::VirtualKeyCode::Bott, - //ffi::XK_topt => events::VirtualKeyCode::Topt, - //ffi::XK_vertbar => events::VirtualKeyCode::Vertbar, - //ffi::XK_emspace => events::VirtualKeyCode::Emspace, - //ffi::XK_enspace => events::VirtualKeyCode::Enspace, - //ffi::XK_em3space => events::VirtualKeyCode::Em3space, - //ffi::XK_em4space => events::VirtualKeyCode::Em4space, - //ffi::XK_digitspace => events::VirtualKeyCode::Digitspace, - //ffi::XK_punctspace => events::VirtualKeyCode::Punctspace, - //ffi::XK_thinspace => events::VirtualKeyCode::Thinspace, - //ffi::XK_hairspace => events::VirtualKeyCode::Hairspace, - //ffi::XK_emdash => events::VirtualKeyCode::Emdash, - //ffi::XK_endash => events::VirtualKeyCode::Endash, - //ffi::XK_signifblank => events::VirtualKeyCode::Signifblank, - //ffi::XK_ellipsis => events::VirtualKeyCode::Ellipsis, - //ffi::XK_doubbaselinedot => events::VirtualKeyCode::Doubbaselinedot, - //ffi::XK_onethird => events::VirtualKeyCode::Onethird, - //ffi::XK_twothirds => events::VirtualKeyCode::Twothirds, - //ffi::XK_onefifth => events::VirtualKeyCode::Onefifth, - //ffi::XK_twofifths => events::VirtualKeyCode::Twofifths, - //ffi::XK_threefifths => events::VirtualKeyCode::Threefifths, - //ffi::XK_fourfifths => events::VirtualKeyCode::Fourfifths, - //ffi::XK_onesixth => events::VirtualKeyCode::Onesixth, - //ffi::XK_fivesixths => events::VirtualKeyCode::Fivesixths, - //ffi::XK_careof => events::VirtualKeyCode::Careof, - //ffi::XK_figdash => events::VirtualKeyCode::Figdash, - //ffi::XK_leftanglebracket => events::VirtualKeyCode::Leftanglebracket, - //ffi::XK_decimalpoint => events::VirtualKeyCode::Decimalpoint, - //ffi::XK_rightanglebracket => events::VirtualKeyCode::Rightanglebracket, - //ffi::XK_marker => events::VirtualKeyCode::Marker, - //ffi::XK_oneeighth => events::VirtualKeyCode::Oneeighth, - //ffi::XK_threeeighths => events::VirtualKeyCode::Threeeighths, - //ffi::XK_fiveeighths => events::VirtualKeyCode::Fiveeighths, - //ffi::XK_seveneighths => events::VirtualKeyCode::Seveneighths, - //ffi::XK_trademark => events::VirtualKeyCode::Trademark, - //ffi::XK_signaturemark => events::VirtualKeyCode::Signaturemark, - //ffi::XK_trademarkincircle => events::VirtualKeyCode::Trademarkincircle, - //ffi::XK_leftopentriangle => events::VirtualKeyCode::Leftopentriangle, - //ffi::XK_rightopentriangle => events::VirtualKeyCode::Rightopentriangle, - //ffi::XK_emopencircle => events::VirtualKeyCode::Emopencircle, - //ffi::XK_emopenrectangle => events::VirtualKeyCode::Emopenrectangle, - //ffi::XK_leftsinglequotemark => events::VirtualKeyCode::Leftsinglequotemark, - //ffi::XK_rightsinglequotemark => events::VirtualKeyCode::Rightsinglequotemark, - //ffi::XK_leftdoublequotemark => events::VirtualKeyCode::Leftdoublequotemark, - //ffi::XK_rightdoublequotemark => events::VirtualKeyCode::Rightdoublequotemark, - //ffi::XK_prescription => events::VirtualKeyCode::Prescription, - //ffi::XK_minutes => events::VirtualKeyCode::Minutes, - //ffi::XK_seconds => events::VirtualKeyCode::Seconds, - //ffi::XK_latincross => events::VirtualKeyCode::Latincross, - //ffi::XK_hexagram => events::VirtualKeyCode::Hexagram, - //ffi::XK_filledrectbullet => events::VirtualKeyCode::Filledrectbullet, - //ffi::XK_filledlefttribullet => events::VirtualKeyCode::Filledlefttribullet, - //ffi::XK_filledrighttribullet => events::VirtualKeyCode::Filledrighttribullet, - //ffi::XK_emfilledcircle => events::VirtualKeyCode::Emfilledcircle, - //ffi::XK_emfilledrect => events::VirtualKeyCode::Emfilledrect, - //ffi::XK_enopencircbullet => events::VirtualKeyCode::Enopencircbullet, - //ffi::XK_enopensquarebullet => events::VirtualKeyCode::Enopensquarebullet, - //ffi::XK_openrectbullet => events::VirtualKeyCode::Openrectbullet, - //ffi::XK_opentribulletup => events::VirtualKeyCode::Opentribulletup, - //ffi::XK_opentribulletdown => events::VirtualKeyCode::Opentribulletdown, - //ffi::XK_openstar => events::VirtualKeyCode::Openstar, - //ffi::XK_enfilledcircbullet => events::VirtualKeyCode::Enfilledcircbullet, - //ffi::XK_enfilledsqbullet => events::VirtualKeyCode::Enfilledsqbullet, - //ffi::XK_filledtribulletup => events::VirtualKeyCode::Filledtribulletup, - //ffi::XK_filledtribulletdown => events::VirtualKeyCode::Filledtribulletdown, - //ffi::XK_leftpointer => events::VirtualKeyCode::Leftpointer, - //ffi::XK_rightpointer => events::VirtualKeyCode::Rightpointer, - //ffi::XK_club => events::VirtualKeyCode::Club, - //ffi::XK_diamond => events::VirtualKeyCode::Diamond, - //ffi::XK_heart => events::VirtualKeyCode::Heart, - //ffi::XK_maltesecross => events::VirtualKeyCode::Maltesecross, - //ffi::XK_dagger => events::VirtualKeyCode::Dagger, - //ffi::XK_doubledagger => events::VirtualKeyCode::Doubledagger, - //ffi::XK_checkmark => events::VirtualKeyCode::Checkmark, - //ffi::XK_ballotcross => events::VirtualKeyCode::Ballotcross, - //ffi::XK_musicalsharp => events::VirtualKeyCode::Musicalsharp, - //ffi::XK_musicalflat => events::VirtualKeyCode::Musicalflat, - //ffi::XK_malesymbol => events::VirtualKeyCode::Malesymbol, - //ffi::XK_femalesymbol => events::VirtualKeyCode::Femalesymbol, - //ffi::XK_telephone => events::VirtualKeyCode::Telephone, - //ffi::XK_telephonerecorder => events::VirtualKeyCode::Telephonerecorder, - //ffi::XK_phonographcopyright => events::VirtualKeyCode::Phonographcopyright, - //ffi::XK_caret => events::VirtualKeyCode::Caret, - //ffi::XK_singlelowquotemark => events::VirtualKeyCode::Singlelowquotemark, - //ffi::XK_doublelowquotemark => events::VirtualKeyCode::Doublelowquotemark, - //ffi::XK_cursor => events::VirtualKeyCode::Cursor, - //ffi::XK_leftcaret => events::VirtualKeyCode::Leftcaret, - //ffi::XK_rightcaret => events::VirtualKeyCode::Rightcaret, - //ffi::XK_downcaret => events::VirtualKeyCode::Downcaret, - //ffi::XK_upcaret => events::VirtualKeyCode::Upcaret, - //ffi::XK_overbar => events::VirtualKeyCode::Overbar, - //ffi::XK_downtack => events::VirtualKeyCode::Downtack, - //ffi::XK_upshoe => events::VirtualKeyCode::Upshoe, - //ffi::XK_downstile => events::VirtualKeyCode::Downstile, - //ffi::XK_underbar => events::VirtualKeyCode::Underbar, - //ffi::XK_jot => events::VirtualKeyCode::Jot, - //ffi::XK_quad => events::VirtualKeyCode::Quad, - //ffi::XK_uptack => events::VirtualKeyCode::Uptack, - //ffi::XK_circle => events::VirtualKeyCode::Circle, - //ffi::XK_upstile => events::VirtualKeyCode::Upstile, - //ffi::XK_downshoe => events::VirtualKeyCode::Downshoe, - //ffi::XK_rightshoe => events::VirtualKeyCode::Rightshoe, - //ffi::XK_leftshoe => events::VirtualKeyCode::Leftshoe, - //ffi::XK_lefttack => events::VirtualKeyCode::Lefttack, - //ffi::XK_righttack => events::VirtualKeyCode::Righttack, - //ffi::XK_hebrew_doublelowline => events::VirtualKeyCode::Hebrew_doublelowline, - //ffi::XK_hebrew_aleph => events::VirtualKeyCode::Hebrew_aleph, - //ffi::XK_hebrew_bet => events::VirtualKeyCode::Hebrew_bet, - //ffi::XK_hebrew_beth => events::VirtualKeyCode::Hebrew_beth, - //ffi::XK_hebrew_gimel => events::VirtualKeyCode::Hebrew_gimel, - //ffi::XK_hebrew_gimmel => events::VirtualKeyCode::Hebrew_gimmel, - //ffi::XK_hebrew_dalet => events::VirtualKeyCode::Hebrew_dalet, - //ffi::XK_hebrew_daleth => events::VirtualKeyCode::Hebrew_daleth, - //ffi::XK_hebrew_he => events::VirtualKeyCode::Hebrew_he, - //ffi::XK_hebrew_waw => events::VirtualKeyCode::Hebrew_waw, - //ffi::XK_hebrew_zain => events::VirtualKeyCode::Hebrew_zain, - //ffi::XK_hebrew_zayin => events::VirtualKeyCode::Hebrew_zayin, - //ffi::XK_hebrew_chet => events::VirtualKeyCode::Hebrew_chet, - //ffi::XK_hebrew_het => events::VirtualKeyCode::Hebrew_het, - //ffi::XK_hebrew_tet => events::VirtualKeyCode::Hebrew_tet, - //ffi::XK_hebrew_teth => events::VirtualKeyCode::Hebrew_teth, - //ffi::XK_hebrew_yod => events::VirtualKeyCode::Hebrew_yod, - //ffi::XK_hebrew_finalkaph => events::VirtualKeyCode::Hebrew_finalkaph, - //ffi::XK_hebrew_kaph => events::VirtualKeyCode::Hebrew_kaph, - //ffi::XK_hebrew_lamed => events::VirtualKeyCode::Hebrew_lamed, - //ffi::XK_hebrew_finalmem => events::VirtualKeyCode::Hebrew_finalmem, - //ffi::XK_hebrew_mem => events::VirtualKeyCode::Hebrew_mem, - //ffi::XK_hebrew_finalnun => events::VirtualKeyCode::Hebrew_finalnun, - //ffi::XK_hebrew_nun => events::VirtualKeyCode::Hebrew_nun, - //ffi::XK_hebrew_samech => events::VirtualKeyCode::Hebrew_samech, - //ffi::XK_hebrew_samekh => events::VirtualKeyCode::Hebrew_samekh, - //ffi::XK_hebrew_ayin => events::VirtualKeyCode::Hebrew_ayin, - //ffi::XK_hebrew_finalpe => events::VirtualKeyCode::Hebrew_finalpe, - //ffi::XK_hebrew_pe => events::VirtualKeyCode::Hebrew_pe, - //ffi::XK_hebrew_finalzade => events::VirtualKeyCode::Hebrew_finalzade, - //ffi::XK_hebrew_finalzadi => events::VirtualKeyCode::Hebrew_finalzadi, - //ffi::XK_hebrew_zade => events::VirtualKeyCode::Hebrew_zade, - //ffi::XK_hebrew_zadi => events::VirtualKeyCode::Hebrew_zadi, - //ffi::XK_hebrew_qoph => events::VirtualKeyCode::Hebrew_qoph, - //ffi::XK_hebrew_kuf => events::VirtualKeyCode::Hebrew_kuf, - //ffi::XK_hebrew_resh => events::VirtualKeyCode::Hebrew_resh, - //ffi::XK_hebrew_shin => events::VirtualKeyCode::Hebrew_shin, - //ffi::XK_hebrew_taw => events::VirtualKeyCode::Hebrew_taw, - //ffi::XK_hebrew_taf => events::VirtualKeyCode::Hebrew_taf, - //ffi::XK_Hebrew_switch => events::VirtualKeyCode::Hebrew_switch, + ffi::XK_BackSpace => VirtualKeyCode::Back, + ffi::XK_Tab => VirtualKeyCode::Tab, + //ffi::XK_Linefeed => VirtualKeyCode::Linefeed, + //ffi::XK_Clear => VirtualKeyCode::Clear, + ffi::XK_Return => VirtualKeyCode::Return, + //ffi::XK_Pause => VirtualKeyCode::Pause, + //ffi::XK_Scroll_Lock => VirtualKeyCode::Scroll_lock, + //ffi::XK_Sys_Req => VirtualKeyCode::Sys_req, + ffi::XK_Escape => VirtualKeyCode::Escape, + ffi::XK_Delete => VirtualKeyCode::Delete, + ffi::XK_Multi_key => VirtualKeyCode::Compose, + //ffi::XK_Kanji => VirtualKeyCode::Kanji, + //ffi::XK_Muhenkan => VirtualKeyCode::Muhenkan, + //ffi::XK_Henkan_Mode => VirtualKeyCode::Henkan_mode, + //ffi::XK_Henkan => VirtualKeyCode::Henkan, + //ffi::XK_Romaji => VirtualKeyCode::Romaji, + //ffi::XK_Hiragana => VirtualKeyCode::Hiragana, + //ffi::XK_Katakana => VirtualKeyCode::Katakana, + //ffi::XK_Hiragana_Katakana => VirtualKeyCode::Hiragana_katakana, + //ffi::XK_Zenkaku => VirtualKeyCode::Zenkaku, + //ffi::XK_Hankaku => VirtualKeyCode::Hankaku, + //ffi::XK_Zenkaku_Hankaku => VirtualKeyCode::Zenkaku_hankaku, + //ffi::XK_Touroku => VirtualKeyCode::Touroku, + //ffi::XK_Massyo => VirtualKeyCode::Massyo, + //ffi::XK_Kana_Lock => VirtualKeyCode::Kana_lock, + //ffi::XK_Kana_Shift => VirtualKeyCode::Kana_shift, + //ffi::XK_Eisu_Shift => VirtualKeyCode::Eisu_shift, + //ffi::XK_Eisu_toggle => VirtualKeyCode::Eisu_toggle, + ffi::XK_Home => VirtualKeyCode::Home, + ffi::XK_Left => VirtualKeyCode::Left, + ffi::XK_Up => VirtualKeyCode::Up, + ffi::XK_Right => VirtualKeyCode::Right, + ffi::XK_Down => VirtualKeyCode::Down, + //ffi::XK_Prior => VirtualKeyCode::Prior, + ffi::XK_Page_Up => VirtualKeyCode::PageUp, + //ffi::XK_Next => VirtualKeyCode::Next, + ffi::XK_Page_Down => VirtualKeyCode::PageDown, + ffi::XK_End => VirtualKeyCode::End, + //ffi::XK_Begin => VirtualKeyCode::Begin, + //ffi::XK_Win_L => VirtualKeyCode::Win_l, + //ffi::XK_Win_R => VirtualKeyCode::Win_r, + //ffi::XK_App => VirtualKeyCode::App, + //ffi::XK_Select => VirtualKeyCode::Select, + //ffi::XK_Print => VirtualKeyCode::Print, + //ffi::XK_Execute => VirtualKeyCode::Execute, + ffi::XK_Insert => VirtualKeyCode::Insert, + //ffi::XK_Undo => VirtualKeyCode::Undo, + //ffi::XK_Redo => VirtualKeyCode::Redo, + //ffi::XK_Menu => VirtualKeyCode::Menu, + //ffi::XK_Find => VirtualKeyCode::Find, + //ffi::XK_Cancel => VirtualKeyCode::Cancel, + //ffi::XK_Help => VirtualKeyCode::Help, + //ffi::XK_Break => VirtualKeyCode::Break, + //ffi::XK_Mode_switch => VirtualKeyCode::Mode_switch, + //ffi::XK_script_switch => VirtualKeyCode::Script_switch, + //ffi::XK_Num_Lock => VirtualKeyCode::Num_lock, + //ffi::XK_KP_Space => VirtualKeyCode::Kp_space, + //ffi::XK_KP_Tab => VirtualKeyCode::Kp_tab, + //ffi::XK_KP_Enter => VirtualKeyCode::Kp_enter, + //ffi::XK_KP_F1 => VirtualKeyCode::Kp_f1, + //ffi::XK_KP_F2 => VirtualKeyCode::Kp_f2, + //ffi::XK_KP_F3 => VirtualKeyCode::Kp_f3, + //ffi::XK_KP_F4 => VirtualKeyCode::Kp_f4, + ffi::XK_KP_Home => VirtualKeyCode::Home, + ffi::XK_KP_Left => VirtualKeyCode::Left, + ffi::XK_KP_Up => VirtualKeyCode::Up, + ffi::XK_KP_Right => VirtualKeyCode::Right, + ffi::XK_KP_Down => VirtualKeyCode::Down, + //ffi::XK_KP_Prior => VirtualKeyCode::Kp_prior, + ffi::XK_KP_Page_Up => VirtualKeyCode::PageUp, + //ffi::XK_KP_Next => VirtualKeyCode::Kp_next, + ffi::XK_KP_Page_Down => VirtualKeyCode::PageDown, + ffi::XK_KP_End => VirtualKeyCode::End, + //ffi::XK_KP_Begin => VirtualKeyCode::Kp_begin, + ffi::XK_KP_Insert => VirtualKeyCode::Insert, + ffi::XK_KP_Delete => VirtualKeyCode::Delete, + ffi::XK_KP_Equal => VirtualKeyCode::NumpadEquals, + //ffi::XK_KP_Multiply => VirtualKeyCode::NumpadMultiply, + ffi::XK_KP_Add => VirtualKeyCode::Add, + //ffi::XK_KP_Separator => VirtualKeyCode::Kp_separator, + ffi::XK_KP_Subtract => VirtualKeyCode::Subtract, + //ffi::XK_KP_Decimal => VirtualKeyCode::Kp_decimal, + ffi::XK_KP_Divide => VirtualKeyCode::Divide, + ffi::XK_KP_0 => VirtualKeyCode::Numpad0, + ffi::XK_KP_1 => VirtualKeyCode::Numpad1, + ffi::XK_KP_2 => VirtualKeyCode::Numpad2, + ffi::XK_KP_3 => VirtualKeyCode::Numpad3, + ffi::XK_KP_4 => VirtualKeyCode::Numpad4, + ffi::XK_KP_5 => VirtualKeyCode::Numpad5, + ffi::XK_KP_6 => VirtualKeyCode::Numpad6, + ffi::XK_KP_7 => VirtualKeyCode::Numpad7, + ffi::XK_KP_8 => VirtualKeyCode::Numpad8, + ffi::XK_KP_9 => VirtualKeyCode::Numpad9, + ffi::XK_F1 => VirtualKeyCode::F1, + ffi::XK_F2 => VirtualKeyCode::F2, + ffi::XK_F3 => VirtualKeyCode::F3, + ffi::XK_F4 => VirtualKeyCode::F4, + ffi::XK_F5 => VirtualKeyCode::F5, + ffi::XK_F6 => VirtualKeyCode::F6, + ffi::XK_F7 => VirtualKeyCode::F7, + ffi::XK_F8 => VirtualKeyCode::F8, + ffi::XK_F9 => VirtualKeyCode::F9, + ffi::XK_F10 => VirtualKeyCode::F10, + ffi::XK_F11 => VirtualKeyCode::F11, + //ffi::XK_L1 => VirtualKeyCode::L1, + ffi::XK_F12 => VirtualKeyCode::F12, + //ffi::XK_L2 => VirtualKeyCode::L2, + ffi::XK_F13 => VirtualKeyCode::F13, + //ffi::XK_L3 => VirtualKeyCode::L3, + ffi::XK_F14 => VirtualKeyCode::F14, + //ffi::XK_L4 => VirtualKeyCode::L4, + ffi::XK_F15 => VirtualKeyCode::F15, + //ffi::XK_L5 => VirtualKeyCode::L5, + ffi::XK_F16 => VirtualKeyCode::F16, + //ffi::XK_L6 => VirtualKeyCode::L6, + ffi::XK_F17 => VirtualKeyCode::F17, + //ffi::XK_L7 => VirtualKeyCode::L7, + ffi::XK_F18 => VirtualKeyCode::F18, + //ffi::XK_L8 => VirtualKeyCode::L8, + ffi::XK_F19 => VirtualKeyCode::F19, + //ffi::XK_L9 => VirtualKeyCode::L9, + ffi::XK_F20 => VirtualKeyCode::F20, + //ffi::XK_L10 => VirtualKeyCode::L10, + ffi::XK_F21 => VirtualKeyCode::F21, + //ffi::XK_R1 => VirtualKeyCode::R1, + ffi::XK_F22 => VirtualKeyCode::F22, + //ffi::XK_R2 => VirtualKeyCode::R2, + ffi::XK_F23 => VirtualKeyCode::F23, + //ffi::XK_R3 => VirtualKeyCode::R3, + ffi::XK_F24 => VirtualKeyCode::F24, + //ffi::XK_R4 => VirtualKeyCode::R4, + //ffi::XK_F25 => VirtualKeyCode::F25, + //ffi::XK_R5 => VirtualKeyCode::R5, + //ffi::XK_F26 => VirtualKeyCode::F26, + //ffi::XK_R6 => VirtualKeyCode::R6, + //ffi::XK_F27 => VirtualKeyCode::F27, + //ffi::XK_R7 => VirtualKeyCode::R7, + //ffi::XK_F28 => VirtualKeyCode::F28, + //ffi::XK_R8 => VirtualKeyCode::R8, + //ffi::XK_F29 => VirtualKeyCode::F29, + //ffi::XK_R9 => VirtualKeyCode::R9, + //ffi::XK_F30 => VirtualKeyCode::F30, + //ffi::XK_R10 => VirtualKeyCode::R10, + //ffi::XK_F31 => VirtualKeyCode::F31, + //ffi::XK_R11 => VirtualKeyCode::R11, + //ffi::XK_F32 => VirtualKeyCode::F32, + //ffi::XK_R12 => VirtualKeyCode::R12, + //ffi::XK_F33 => VirtualKeyCode::F33, + //ffi::XK_R13 => VirtualKeyCode::R13, + //ffi::XK_F34 => VirtualKeyCode::F34, + //ffi::XK_R14 => VirtualKeyCode::R14, + //ffi::XK_F35 => VirtualKeyCode::F35, + //ffi::XK_R15 => VirtualKeyCode::R15, + ffi::XK_Shift_L => VirtualKeyCode::LShift, + ffi::XK_Shift_R => VirtualKeyCode::RShift, + ffi::XK_Control_L => VirtualKeyCode::LControl, + ffi::XK_Control_R => VirtualKeyCode::RControl, + //ffi::XK_Caps_Lock => VirtualKeyCode::Caps_lock, + //ffi::XK_Shift_Lock => VirtualKeyCode::Shift_lock, + //ffi::XK_Meta_L => VirtualKeyCode::Meta_l, + //ffi::XK_Meta_R => VirtualKeyCode::Meta_r, + ffi::XK_Alt_L => VirtualKeyCode::LAlt, + ffi::XK_Alt_R => VirtualKeyCode::RAlt, + //ffi::XK_Super_L => VirtualKeyCode::Super_l, + //ffi::XK_Super_R => VirtualKeyCode::Super_r, + //ffi::XK_Hyper_L => VirtualKeyCode::Hyper_l, + //ffi::XK_Hyper_R => VirtualKeyCode::Hyper_r, + ffi::XK_ISO_Left_Tab => VirtualKeyCode::Tab, + ffi::XK_space => VirtualKeyCode::Space, + //ffi::XK_exclam => VirtualKeyCode::Exclam, + //ffi::XK_quotedbl => VirtualKeyCode::Quotedbl, + //ffi::XK_numbersign => VirtualKeyCode::Numbersign, + //ffi::XK_dollar => VirtualKeyCode::Dollar, + //ffi::XK_percent => VirtualKeyCode::Percent, + //ffi::XK_ampersand => VirtualKeyCode::Ampersand, + ffi::XK_apostrophe => VirtualKeyCode::Apostrophe, + //ffi::XK_quoteright => VirtualKeyCode::Quoteright, + //ffi::XK_parenleft => VirtualKeyCode::Parenleft, + //ffi::XK_parenright => VirtualKeyCode::Parenright, + //ffi::XK_asterisk => VirtualKeyCode::Asterisk, + ffi::XK_plus => VirtualKeyCode::Add, + ffi::XK_comma => VirtualKeyCode::Comma, + ffi::XK_minus => VirtualKeyCode::Subtract, + ffi::XK_period => VirtualKeyCode::Period, + ffi::XK_slash => VirtualKeyCode::Slash, + ffi::XK_0 => VirtualKeyCode::Key0, + ffi::XK_1 => VirtualKeyCode::Key1, + ffi::XK_2 => VirtualKeyCode::Key2, + ffi::XK_3 => VirtualKeyCode::Key3, + ffi::XK_4 => VirtualKeyCode::Key4, + ffi::XK_5 => VirtualKeyCode::Key5, + ffi::XK_6 => VirtualKeyCode::Key6, + ffi::XK_7 => VirtualKeyCode::Key7, + ffi::XK_8 => VirtualKeyCode::Key8, + ffi::XK_9 => VirtualKeyCode::Key9, + ffi::XK_colon => VirtualKeyCode::Colon, + ffi::XK_semicolon => VirtualKeyCode::Semicolon, + //ffi::XK_less => VirtualKeyCode::Less, + ffi::XK_equal => VirtualKeyCode::Equals, + //ffi::XK_greater => VirtualKeyCode::Greater, + //ffi::XK_question => VirtualKeyCode::Question, + ffi::XK_at => VirtualKeyCode::At, + ffi::XK_A => VirtualKeyCode::A, + ffi::XK_B => VirtualKeyCode::B, + ffi::XK_C => VirtualKeyCode::C, + ffi::XK_D => VirtualKeyCode::D, + ffi::XK_E => VirtualKeyCode::E, + ffi::XK_F => VirtualKeyCode::F, + ffi::XK_G => VirtualKeyCode::G, + ffi::XK_H => VirtualKeyCode::H, + ffi::XK_I => VirtualKeyCode::I, + ffi::XK_J => VirtualKeyCode::J, + ffi::XK_K => VirtualKeyCode::K, + ffi::XK_L => VirtualKeyCode::L, + ffi::XK_M => VirtualKeyCode::M, + ffi::XK_N => VirtualKeyCode::N, + ffi::XK_O => VirtualKeyCode::O, + ffi::XK_P => VirtualKeyCode::P, + ffi::XK_Q => VirtualKeyCode::Q, + ffi::XK_R => VirtualKeyCode::R, + ffi::XK_S => VirtualKeyCode::S, + ffi::XK_T => VirtualKeyCode::T, + ffi::XK_U => VirtualKeyCode::U, + ffi::XK_V => VirtualKeyCode::V, + ffi::XK_W => VirtualKeyCode::W, + ffi::XK_X => VirtualKeyCode::X, + ffi::XK_Y => VirtualKeyCode::Y, + ffi::XK_Z => VirtualKeyCode::Z, + ffi::XK_bracketleft => VirtualKeyCode::LBracket, + ffi::XK_backslash => VirtualKeyCode::Backslash, + ffi::XK_bracketright => VirtualKeyCode::RBracket, + //ffi::XK_asciicircum => VirtualKeyCode::Asciicircum, + //ffi::XK_underscore => VirtualKeyCode::Underscore, + ffi::XK_grave => VirtualKeyCode::Grave, + //ffi::XK_quoteleft => VirtualKeyCode::Quoteleft, + ffi::XK_a => VirtualKeyCode::A, + ffi::XK_b => VirtualKeyCode::B, + ffi::XK_c => VirtualKeyCode::C, + ffi::XK_d => VirtualKeyCode::D, + ffi::XK_e => VirtualKeyCode::E, + ffi::XK_f => VirtualKeyCode::F, + ffi::XK_g => VirtualKeyCode::G, + ffi::XK_h => VirtualKeyCode::H, + ffi::XK_i => VirtualKeyCode::I, + ffi::XK_j => VirtualKeyCode::J, + ffi::XK_k => VirtualKeyCode::K, + ffi::XK_l => VirtualKeyCode::L, + ffi::XK_m => VirtualKeyCode::M, + ffi::XK_n => VirtualKeyCode::N, + ffi::XK_o => VirtualKeyCode::O, + ffi::XK_p => VirtualKeyCode::P, + ffi::XK_q => VirtualKeyCode::Q, + ffi::XK_r => VirtualKeyCode::R, + ffi::XK_s => VirtualKeyCode::S, + ffi::XK_t => VirtualKeyCode::T, + ffi::XK_u => VirtualKeyCode::U, + ffi::XK_v => VirtualKeyCode::V, + ffi::XK_w => VirtualKeyCode::W, + ffi::XK_x => VirtualKeyCode::X, + ffi::XK_y => VirtualKeyCode::Y, + ffi::XK_z => VirtualKeyCode::Z, + //ffi::XK_braceleft => VirtualKeyCode::Braceleft, + //ffi::XK_bar => VirtualKeyCode::Bar, + //ffi::XK_braceright => VirtualKeyCode::Braceright, + //ffi::XK_asciitilde => VirtualKeyCode::Asciitilde, + //ffi::XK_nobreakspace => VirtualKeyCode::Nobreakspace, + //ffi::XK_exclamdown => VirtualKeyCode::Exclamdown, + //ffi::XK_cent => VirtualKeyCode::Cent, + //ffi::XK_sterling => VirtualKeyCode::Sterling, + //ffi::XK_currency => VirtualKeyCode::Currency, + //ffi::XK_yen => VirtualKeyCode::Yen, + //ffi::XK_brokenbar => VirtualKeyCode::Brokenbar, + //ffi::XK_section => VirtualKeyCode::Section, + //ffi::XK_diaeresis => VirtualKeyCode::Diaeresis, + //ffi::XK_copyright => VirtualKeyCode::Copyright, + //ffi::XK_ordfeminine => VirtualKeyCode::Ordfeminine, + //ffi::XK_guillemotleft => VirtualKeyCode::Guillemotleft, + //ffi::XK_notsign => VirtualKeyCode::Notsign, + //ffi::XK_hyphen => VirtualKeyCode::Hyphen, + //ffi::XK_registered => VirtualKeyCode::Registered, + //ffi::XK_macron => VirtualKeyCode::Macron, + //ffi::XK_degree => VirtualKeyCode::Degree, + //ffi::XK_plusminus => VirtualKeyCode::Plusminus, + //ffi::XK_twosuperior => VirtualKeyCode::Twosuperior, + //ffi::XK_threesuperior => VirtualKeyCode::Threesuperior, + //ffi::XK_acute => VirtualKeyCode::Acute, + //ffi::XK_mu => VirtualKeyCode::Mu, + //ffi::XK_paragraph => VirtualKeyCode::Paragraph, + //ffi::XK_periodcentered => VirtualKeyCode::Periodcentered, + //ffi::XK_cedilla => VirtualKeyCode::Cedilla, + //ffi::XK_onesuperior => VirtualKeyCode::Onesuperior, + //ffi::XK_masculine => VirtualKeyCode::Masculine, + //ffi::XK_guillemotright => VirtualKeyCode::Guillemotright, + //ffi::XK_onequarter => VirtualKeyCode::Onequarter, + //ffi::XK_onehalf => VirtualKeyCode::Onehalf, + //ffi::XK_threequarters => VirtualKeyCode::Threequarters, + //ffi::XK_questiondown => VirtualKeyCode::Questiondown, + //ffi::XK_Agrave => VirtualKeyCode::Agrave, + //ffi::XK_Aacute => VirtualKeyCode::Aacute, + //ffi::XK_Acircumflex => VirtualKeyCode::Acircumflex, + //ffi::XK_Atilde => VirtualKeyCode::Atilde, + //ffi::XK_Adiaeresis => VirtualKeyCode::Adiaeresis, + //ffi::XK_Aring => VirtualKeyCode::Aring, + //ffi::XK_AE => VirtualKeyCode::Ae, + //ffi::XK_Ccedilla => VirtualKeyCode::Ccedilla, + //ffi::XK_Egrave => VirtualKeyCode::Egrave, + //ffi::XK_Eacute => VirtualKeyCode::Eacute, + //ffi::XK_Ecircumflex => VirtualKeyCode::Ecircumflex, + //ffi::XK_Ediaeresis => VirtualKeyCode::Ediaeresis, + //ffi::XK_Igrave => VirtualKeyCode::Igrave, + //ffi::XK_Iacute => VirtualKeyCode::Iacute, + //ffi::XK_Icircumflex => VirtualKeyCode::Icircumflex, + //ffi::XK_Idiaeresis => VirtualKeyCode::Idiaeresis, + //ffi::XK_ETH => VirtualKeyCode::Eth, + //ffi::XK_Eth => VirtualKeyCode::Eth, + //ffi::XK_Ntilde => VirtualKeyCode::Ntilde, + //ffi::XK_Ograve => VirtualKeyCode::Ograve, + //ffi::XK_Oacute => VirtualKeyCode::Oacute, + //ffi::XK_Ocircumflex => VirtualKeyCode::Ocircumflex, + //ffi::XK_Otilde => VirtualKeyCode::Otilde, + //ffi::XK_Odiaeresis => VirtualKeyCode::Odiaeresis, + //ffi::XK_multiply => VirtualKeyCode::Multiply, + //ffi::XK_Ooblique => VirtualKeyCode::Ooblique, + //ffi::XK_Ugrave => VirtualKeyCode::Ugrave, + //ffi::XK_Uacute => VirtualKeyCode::Uacute, + //ffi::XK_Ucircumflex => VirtualKeyCode::Ucircumflex, + //ffi::XK_Udiaeresis => VirtualKeyCode::Udiaeresis, + //ffi::XK_Yacute => VirtualKeyCode::Yacute, + //ffi::XK_THORN => VirtualKeyCode::Thorn, + //ffi::XK_Thorn => VirtualKeyCode::Thorn, + //ffi::XK_ssharp => VirtualKeyCode::Ssharp, + //ffi::XK_agrave => VirtualKeyCode::Agrave, + //ffi::XK_aacute => VirtualKeyCode::Aacute, + //ffi::XK_acircumflex => VirtualKeyCode::Acircumflex, + //ffi::XK_atilde => VirtualKeyCode::Atilde, + //ffi::XK_adiaeresis => VirtualKeyCode::Adiaeresis, + //ffi::XK_aring => VirtualKeyCode::Aring, + //ffi::XK_ae => VirtualKeyCode::Ae, + //ffi::XK_ccedilla => VirtualKeyCode::Ccedilla, + //ffi::XK_egrave => VirtualKeyCode::Egrave, + //ffi::XK_eacute => VirtualKeyCode::Eacute, + //ffi::XK_ecircumflex => VirtualKeyCode::Ecircumflex, + //ffi::XK_ediaeresis => VirtualKeyCode::Ediaeresis, + //ffi::XK_igrave => VirtualKeyCode::Igrave, + //ffi::XK_iacute => VirtualKeyCode::Iacute, + //ffi::XK_icircumflex => VirtualKeyCode::Icircumflex, + //ffi::XK_idiaeresis => VirtualKeyCode::Idiaeresis, + //ffi::XK_eth => VirtualKeyCode::Eth, + //ffi::XK_ntilde => VirtualKeyCode::Ntilde, + //ffi::XK_ograve => VirtualKeyCode::Ograve, + //ffi::XK_oacute => VirtualKeyCode::Oacute, + //ffi::XK_ocircumflex => VirtualKeyCode::Ocircumflex, + //ffi::XK_otilde => VirtualKeyCode::Otilde, + //ffi::XK_odiaeresis => VirtualKeyCode::Odiaeresis, + //ffi::XK_division => VirtualKeyCode::Division, + //ffi::XK_oslash => VirtualKeyCode::Oslash, + //ffi::XK_ugrave => VirtualKeyCode::Ugrave, + //ffi::XK_uacute => VirtualKeyCode::Uacute, + //ffi::XK_ucircumflex => VirtualKeyCode::Ucircumflex, + //ffi::XK_udiaeresis => VirtualKeyCode::Udiaeresis, + //ffi::XK_yacute => VirtualKeyCode::Yacute, + //ffi::XK_thorn => VirtualKeyCode::Thorn, + //ffi::XK_ydiaeresis => VirtualKeyCode::Ydiaeresis, + //ffi::XK_Aogonek => VirtualKeyCode::Aogonek, + //ffi::XK_breve => VirtualKeyCode::Breve, + //ffi::XK_Lstroke => VirtualKeyCode::Lstroke, + //ffi::XK_Lcaron => VirtualKeyCode::Lcaron, + //ffi::XK_Sacute => VirtualKeyCode::Sacute, + //ffi::XK_Scaron => VirtualKeyCode::Scaron, + //ffi::XK_Scedilla => VirtualKeyCode::Scedilla, + //ffi::XK_Tcaron => VirtualKeyCode::Tcaron, + //ffi::XK_Zacute => VirtualKeyCode::Zacute, + //ffi::XK_Zcaron => VirtualKeyCode::Zcaron, + //ffi::XK_Zabovedot => VirtualKeyCode::Zabovedot, + //ffi::XK_aogonek => VirtualKeyCode::Aogonek, + //ffi::XK_ogonek => VirtualKeyCode::Ogonek, + //ffi::XK_lstroke => VirtualKeyCode::Lstroke, + //ffi::XK_lcaron => VirtualKeyCode::Lcaron, + //ffi::XK_sacute => VirtualKeyCode::Sacute, + //ffi::XK_caron => VirtualKeyCode::Caron, + //ffi::XK_scaron => VirtualKeyCode::Scaron, + //ffi::XK_scedilla => VirtualKeyCode::Scedilla, + //ffi::XK_tcaron => VirtualKeyCode::Tcaron, + //ffi::XK_zacute => VirtualKeyCode::Zacute, + //ffi::XK_doubleacute => VirtualKeyCode::Doubleacute, + //ffi::XK_zcaron => VirtualKeyCode::Zcaron, + //ffi::XK_zabovedot => VirtualKeyCode::Zabovedot, + //ffi::XK_Racute => VirtualKeyCode::Racute, + //ffi::XK_Abreve => VirtualKeyCode::Abreve, + //ffi::XK_Lacute => VirtualKeyCode::Lacute, + //ffi::XK_Cacute => VirtualKeyCode::Cacute, + //ffi::XK_Ccaron => VirtualKeyCode::Ccaron, + //ffi::XK_Eogonek => VirtualKeyCode::Eogonek, + //ffi::XK_Ecaron => VirtualKeyCode::Ecaron, + //ffi::XK_Dcaron => VirtualKeyCode::Dcaron, + //ffi::XK_Dstroke => VirtualKeyCode::Dstroke, + //ffi::XK_Nacute => VirtualKeyCode::Nacute, + //ffi::XK_Ncaron => VirtualKeyCode::Ncaron, + //ffi::XK_Odoubleacute => VirtualKeyCode::Odoubleacute, + //ffi::XK_Rcaron => VirtualKeyCode::Rcaron, + //ffi::XK_Uring => VirtualKeyCode::Uring, + //ffi::XK_Udoubleacute => VirtualKeyCode::Udoubleacute, + //ffi::XK_Tcedilla => VirtualKeyCode::Tcedilla, + //ffi::XK_racute => VirtualKeyCode::Racute, + //ffi::XK_abreve => VirtualKeyCode::Abreve, + //ffi::XK_lacute => VirtualKeyCode::Lacute, + //ffi::XK_cacute => VirtualKeyCode::Cacute, + //ffi::XK_ccaron => VirtualKeyCode::Ccaron, + //ffi::XK_eogonek => VirtualKeyCode::Eogonek, + //ffi::XK_ecaron => VirtualKeyCode::Ecaron, + //ffi::XK_dcaron => VirtualKeyCode::Dcaron, + //ffi::XK_dstroke => VirtualKeyCode::Dstroke, + //ffi::XK_nacute => VirtualKeyCode::Nacute, + //ffi::XK_ncaron => VirtualKeyCode::Ncaron, + //ffi::XK_odoubleacute => VirtualKeyCode::Odoubleacute, + //ffi::XK_udoubleacute => VirtualKeyCode::Udoubleacute, + //ffi::XK_rcaron => VirtualKeyCode::Rcaron, + //ffi::XK_uring => VirtualKeyCode::Uring, + //ffi::XK_tcedilla => VirtualKeyCode::Tcedilla, + //ffi::XK_abovedot => VirtualKeyCode::Abovedot, + //ffi::XK_Hstroke => VirtualKeyCode::Hstroke, + //ffi::XK_Hcircumflex => VirtualKeyCode::Hcircumflex, + //ffi::XK_Iabovedot => VirtualKeyCode::Iabovedot, + //ffi::XK_Gbreve => VirtualKeyCode::Gbreve, + //ffi::XK_Jcircumflex => VirtualKeyCode::Jcircumflex, + //ffi::XK_hstroke => VirtualKeyCode::Hstroke, + //ffi::XK_hcircumflex => VirtualKeyCode::Hcircumflex, + //ffi::XK_idotless => VirtualKeyCode::Idotless, + //ffi::XK_gbreve => VirtualKeyCode::Gbreve, + //ffi::XK_jcircumflex => VirtualKeyCode::Jcircumflex, + //ffi::XK_Cabovedot => VirtualKeyCode::Cabovedot, + //ffi::XK_Ccircumflex => VirtualKeyCode::Ccircumflex, + //ffi::XK_Gabovedot => VirtualKeyCode::Gabovedot, + //ffi::XK_Gcircumflex => VirtualKeyCode::Gcircumflex, + //ffi::XK_Ubreve => VirtualKeyCode::Ubreve, + //ffi::XK_Scircumflex => VirtualKeyCode::Scircumflex, + //ffi::XK_cabovedot => VirtualKeyCode::Cabovedot, + //ffi::XK_ccircumflex => VirtualKeyCode::Ccircumflex, + //ffi::XK_gabovedot => VirtualKeyCode::Gabovedot, + //ffi::XK_gcircumflex => VirtualKeyCode::Gcircumflex, + //ffi::XK_ubreve => VirtualKeyCode::Ubreve, + //ffi::XK_scircumflex => VirtualKeyCode::Scircumflex, + //ffi::XK_kra => VirtualKeyCode::Kra, + //ffi::XK_kappa => VirtualKeyCode::Kappa, + //ffi::XK_Rcedilla => VirtualKeyCode::Rcedilla, + //ffi::XK_Itilde => VirtualKeyCode::Itilde, + //ffi::XK_Lcedilla => VirtualKeyCode::Lcedilla, + //ffi::XK_Emacron => VirtualKeyCode::Emacron, + //ffi::XK_Gcedilla => VirtualKeyCode::Gcedilla, + //ffi::XK_Tslash => VirtualKeyCode::Tslash, + //ffi::XK_rcedilla => VirtualKeyCode::Rcedilla, + //ffi::XK_itilde => VirtualKeyCode::Itilde, + //ffi::XK_lcedilla => VirtualKeyCode::Lcedilla, + //ffi::XK_emacron => VirtualKeyCode::Emacron, + //ffi::XK_gcedilla => VirtualKeyCode::Gcedilla, + //ffi::XK_tslash => VirtualKeyCode::Tslash, + //ffi::XK_ENG => VirtualKeyCode::Eng, + //ffi::XK_eng => VirtualKeyCode::Eng, + //ffi::XK_Amacron => VirtualKeyCode::Amacron, + //ffi::XK_Iogonek => VirtualKeyCode::Iogonek, + //ffi::XK_Eabovedot => VirtualKeyCode::Eabovedot, + //ffi::XK_Imacron => VirtualKeyCode::Imacron, + //ffi::XK_Ncedilla => VirtualKeyCode::Ncedilla, + //ffi::XK_Omacron => VirtualKeyCode::Omacron, + //ffi::XK_Kcedilla => VirtualKeyCode::Kcedilla, + //ffi::XK_Uogonek => VirtualKeyCode::Uogonek, + //ffi::XK_Utilde => VirtualKeyCode::Utilde, + //ffi::XK_Umacron => VirtualKeyCode::Umacron, + //ffi::XK_amacron => VirtualKeyCode::Amacron, + //ffi::XK_iogonek => VirtualKeyCode::Iogonek, + //ffi::XK_eabovedot => VirtualKeyCode::Eabovedot, + //ffi::XK_imacron => VirtualKeyCode::Imacron, + //ffi::XK_ncedilla => VirtualKeyCode::Ncedilla, + //ffi::XK_omacron => VirtualKeyCode::Omacron, + //ffi::XK_kcedilla => VirtualKeyCode::Kcedilla, + //ffi::XK_uogonek => VirtualKeyCode::Uogonek, + //ffi::XK_utilde => VirtualKeyCode::Utilde, + //ffi::XK_umacron => VirtualKeyCode::Umacron, + //ffi::XK_overline => VirtualKeyCode::Overline, + //ffi::XK_kana_fullstop => VirtualKeyCode::Kana_fullstop, + //ffi::XK_kana_openingbracket => VirtualKeyCode::Kana_openingbracket, + //ffi::XK_kana_closingbracket => VirtualKeyCode::Kana_closingbracket, + //ffi::XK_kana_comma => VirtualKeyCode::Kana_comma, + //ffi::XK_kana_conjunctive => VirtualKeyCode::Kana_conjunctive, + //ffi::XK_kana_middledot => VirtualKeyCode::Kana_middledot, + //ffi::XK_kana_WO => VirtualKeyCode::Kana_wo, + //ffi::XK_kana_a => VirtualKeyCode::Kana_a, + //ffi::XK_kana_i => VirtualKeyCode::Kana_i, + //ffi::XK_kana_u => VirtualKeyCode::Kana_u, + //ffi::XK_kana_e => VirtualKeyCode::Kana_e, + //ffi::XK_kana_o => VirtualKeyCode::Kana_o, + //ffi::XK_kana_ya => VirtualKeyCode::Kana_ya, + //ffi::XK_kana_yu => VirtualKeyCode::Kana_yu, + //ffi::XK_kana_yo => VirtualKeyCode::Kana_yo, + //ffi::XK_kana_tsu => VirtualKeyCode::Kana_tsu, + //ffi::XK_kana_tu => VirtualKeyCode::Kana_tu, + //ffi::XK_prolongedsound => VirtualKeyCode::Prolongedsound, + //ffi::XK_kana_A => VirtualKeyCode::Kana_a, + //ffi::XK_kana_I => VirtualKeyCode::Kana_i, + //ffi::XK_kana_U => VirtualKeyCode::Kana_u, + //ffi::XK_kana_E => VirtualKeyCode::Kana_e, + //ffi::XK_kana_O => VirtualKeyCode::Kana_o, + //ffi::XK_kana_KA => VirtualKeyCode::Kana_ka, + //ffi::XK_kana_KI => VirtualKeyCode::Kana_ki, + //ffi::XK_kana_KU => VirtualKeyCode::Kana_ku, + //ffi::XK_kana_KE => VirtualKeyCode::Kana_ke, + //ffi::XK_kana_KO => VirtualKeyCode::Kana_ko, + //ffi::XK_kana_SA => VirtualKeyCode::Kana_sa, + //ffi::XK_kana_SHI => VirtualKeyCode::Kana_shi, + //ffi::XK_kana_SU => VirtualKeyCode::Kana_su, + //ffi::XK_kana_SE => VirtualKeyCode::Kana_se, + //ffi::XK_kana_SO => VirtualKeyCode::Kana_so, + //ffi::XK_kana_TA => VirtualKeyCode::Kana_ta, + //ffi::XK_kana_CHI => VirtualKeyCode::Kana_chi, + //ffi::XK_kana_TI => VirtualKeyCode::Kana_ti, + //ffi::XK_kana_TSU => VirtualKeyCode::Kana_tsu, + //ffi::XK_kana_TU => VirtualKeyCode::Kana_tu, + //ffi::XK_kana_TE => VirtualKeyCode::Kana_te, + //ffi::XK_kana_TO => VirtualKeyCode::Kana_to, + //ffi::XK_kana_NA => VirtualKeyCode::Kana_na, + //ffi::XK_kana_NI => VirtualKeyCode::Kana_ni, + //ffi::XK_kana_NU => VirtualKeyCode::Kana_nu, + //ffi::XK_kana_NE => VirtualKeyCode::Kana_ne, + //ffi::XK_kana_NO => VirtualKeyCode::Kana_no, + //ffi::XK_kana_HA => VirtualKeyCode::Kana_ha, + //ffi::XK_kana_HI => VirtualKeyCode::Kana_hi, + //ffi::XK_kana_FU => VirtualKeyCode::Kana_fu, + //ffi::XK_kana_HU => VirtualKeyCode::Kana_hu, + //ffi::XK_kana_HE => VirtualKeyCode::Kana_he, + //ffi::XK_kana_HO => VirtualKeyCode::Kana_ho, + //ffi::XK_kana_MA => VirtualKeyCode::Kana_ma, + //ffi::XK_kana_MI => VirtualKeyCode::Kana_mi, + //ffi::XK_kana_MU => VirtualKeyCode::Kana_mu, + //ffi::XK_kana_ME => VirtualKeyCode::Kana_me, + //ffi::XK_kana_MO => VirtualKeyCode::Kana_mo, + //ffi::XK_kana_YA => VirtualKeyCode::Kana_ya, + //ffi::XK_kana_YU => VirtualKeyCode::Kana_yu, + //ffi::XK_kana_YO => VirtualKeyCode::Kana_yo, + //ffi::XK_kana_RA => VirtualKeyCode::Kana_ra, + //ffi::XK_kana_RI => VirtualKeyCode::Kana_ri, + //ffi::XK_kana_RU => VirtualKeyCode::Kana_ru, + //ffi::XK_kana_RE => VirtualKeyCode::Kana_re, + //ffi::XK_kana_RO => VirtualKeyCode::Kana_ro, + //ffi::XK_kana_WA => VirtualKeyCode::Kana_wa, + //ffi::XK_kana_N => VirtualKeyCode::Kana_n, + //ffi::XK_voicedsound => VirtualKeyCode::Voicedsound, + //ffi::XK_semivoicedsound => VirtualKeyCode::Semivoicedsound, + //ffi::XK_kana_switch => VirtualKeyCode::Kana_switch, + //ffi::XK_Arabic_comma => VirtualKeyCode::Arabic_comma, + //ffi::XK_Arabic_semicolon => VirtualKeyCode::Arabic_semicolon, + //ffi::XK_Arabic_question_mark => VirtualKeyCode::Arabic_question_mark, + //ffi::XK_Arabic_hamza => VirtualKeyCode::Arabic_hamza, + //ffi::XK_Arabic_maddaonalef => VirtualKeyCode::Arabic_maddaonalef, + //ffi::XK_Arabic_hamzaonalef => VirtualKeyCode::Arabic_hamzaonalef, + //ffi::XK_Arabic_hamzaonwaw => VirtualKeyCode::Arabic_hamzaonwaw, + //ffi::XK_Arabic_hamzaunderalef => VirtualKeyCode::Arabic_hamzaunderalef, + //ffi::XK_Arabic_hamzaonyeh => VirtualKeyCode::Arabic_hamzaonyeh, + //ffi::XK_Arabic_alef => VirtualKeyCode::Arabic_alef, + //ffi::XK_Arabic_beh => VirtualKeyCode::Arabic_beh, + //ffi::XK_Arabic_tehmarbuta => VirtualKeyCode::Arabic_tehmarbuta, + //ffi::XK_Arabic_teh => VirtualKeyCode::Arabic_teh, + //ffi::XK_Arabic_theh => VirtualKeyCode::Arabic_theh, + //ffi::XK_Arabic_jeem => VirtualKeyCode::Arabic_jeem, + //ffi::XK_Arabic_hah => VirtualKeyCode::Arabic_hah, + //ffi::XK_Arabic_khah => VirtualKeyCode::Arabic_khah, + //ffi::XK_Arabic_dal => VirtualKeyCode::Arabic_dal, + //ffi::XK_Arabic_thal => VirtualKeyCode::Arabic_thal, + //ffi::XK_Arabic_ra => VirtualKeyCode::Arabic_ra, + //ffi::XK_Arabic_zain => VirtualKeyCode::Arabic_zain, + //ffi::XK_Arabic_seen => VirtualKeyCode::Arabic_seen, + //ffi::XK_Arabic_sheen => VirtualKeyCode::Arabic_sheen, + //ffi::XK_Arabic_sad => VirtualKeyCode::Arabic_sad, + //ffi::XK_Arabic_dad => VirtualKeyCode::Arabic_dad, + //ffi::XK_Arabic_tah => VirtualKeyCode::Arabic_tah, + //ffi::XK_Arabic_zah => VirtualKeyCode::Arabic_zah, + //ffi::XK_Arabic_ain => VirtualKeyCode::Arabic_ain, + //ffi::XK_Arabic_ghain => VirtualKeyCode::Arabic_ghain, + //ffi::XK_Arabic_tatweel => VirtualKeyCode::Arabic_tatweel, + //ffi::XK_Arabic_feh => VirtualKeyCode::Arabic_feh, + //ffi::XK_Arabic_qaf => VirtualKeyCode::Arabic_qaf, + //ffi::XK_Arabic_kaf => VirtualKeyCode::Arabic_kaf, + //ffi::XK_Arabic_lam => VirtualKeyCode::Arabic_lam, + //ffi::XK_Arabic_meem => VirtualKeyCode::Arabic_meem, + //ffi::XK_Arabic_noon => VirtualKeyCode::Arabic_noon, + //ffi::XK_Arabic_ha => VirtualKeyCode::Arabic_ha, + //ffi::XK_Arabic_heh => VirtualKeyCode::Arabic_heh, + //ffi::XK_Arabic_waw => VirtualKeyCode::Arabic_waw, + //ffi::XK_Arabic_alefmaksura => VirtualKeyCode::Arabic_alefmaksura, + //ffi::XK_Arabic_yeh => VirtualKeyCode::Arabic_yeh, + //ffi::XK_Arabic_fathatan => VirtualKeyCode::Arabic_fathatan, + //ffi::XK_Arabic_dammatan => VirtualKeyCode::Arabic_dammatan, + //ffi::XK_Arabic_kasratan => VirtualKeyCode::Arabic_kasratan, + //ffi::XK_Arabic_fatha => VirtualKeyCode::Arabic_fatha, + //ffi::XK_Arabic_damma => VirtualKeyCode::Arabic_damma, + //ffi::XK_Arabic_kasra => VirtualKeyCode::Arabic_kasra, + //ffi::XK_Arabic_shadda => VirtualKeyCode::Arabic_shadda, + //ffi::XK_Arabic_sukun => VirtualKeyCode::Arabic_sukun, + //ffi::XK_Arabic_switch => VirtualKeyCode::Arabic_switch, + //ffi::XK_Serbian_dje => VirtualKeyCode::Serbian_dje, + //ffi::XK_Macedonia_gje => VirtualKeyCode::Macedonia_gje, + //ffi::XK_Cyrillic_io => VirtualKeyCode::Cyrillic_io, + //ffi::XK_Ukrainian_ie => VirtualKeyCode::Ukrainian_ie, + //ffi::XK_Ukranian_je => VirtualKeyCode::Ukranian_je, + //ffi::XK_Macedonia_dse => VirtualKeyCode::Macedonia_dse, + //ffi::XK_Ukrainian_i => VirtualKeyCode::Ukrainian_i, + //ffi::XK_Ukranian_i => VirtualKeyCode::Ukranian_i, + //ffi::XK_Ukrainian_yi => VirtualKeyCode::Ukrainian_yi, + //ffi::XK_Ukranian_yi => VirtualKeyCode::Ukranian_yi, + //ffi::XK_Cyrillic_je => VirtualKeyCode::Cyrillic_je, + //ffi::XK_Serbian_je => VirtualKeyCode::Serbian_je, + //ffi::XK_Cyrillic_lje => VirtualKeyCode::Cyrillic_lje, + //ffi::XK_Serbian_lje => VirtualKeyCode::Serbian_lje, + //ffi::XK_Cyrillic_nje => VirtualKeyCode::Cyrillic_nje, + //ffi::XK_Serbian_nje => VirtualKeyCode::Serbian_nje, + //ffi::XK_Serbian_tshe => VirtualKeyCode::Serbian_tshe, + //ffi::XK_Macedonia_kje => VirtualKeyCode::Macedonia_kje, + //ffi::XK_Byelorussian_shortu => VirtualKeyCode::Byelorussian_shortu, + //ffi::XK_Cyrillic_dzhe => VirtualKeyCode::Cyrillic_dzhe, + //ffi::XK_Serbian_dze => VirtualKeyCode::Serbian_dze, + //ffi::XK_numerosign => VirtualKeyCode::Numerosign, + //ffi::XK_Serbian_DJE => VirtualKeyCode::Serbian_dje, + //ffi::XK_Macedonia_GJE => VirtualKeyCode::Macedonia_gje, + //ffi::XK_Cyrillic_IO => VirtualKeyCode::Cyrillic_io, + //ffi::XK_Ukrainian_IE => VirtualKeyCode::Ukrainian_ie, + //ffi::XK_Ukranian_JE => VirtualKeyCode::Ukranian_je, + //ffi::XK_Macedonia_DSE => VirtualKeyCode::Macedonia_dse, + //ffi::XK_Ukrainian_I => VirtualKeyCode::Ukrainian_i, + //ffi::XK_Ukranian_I => VirtualKeyCode::Ukranian_i, + //ffi::XK_Ukrainian_YI => VirtualKeyCode::Ukrainian_yi, + //ffi::XK_Ukranian_YI => VirtualKeyCode::Ukranian_yi, + //ffi::XK_Cyrillic_JE => VirtualKeyCode::Cyrillic_je, + //ffi::XK_Serbian_JE => VirtualKeyCode::Serbian_je, + //ffi::XK_Cyrillic_LJE => VirtualKeyCode::Cyrillic_lje, + //ffi::XK_Serbian_LJE => VirtualKeyCode::Serbian_lje, + //ffi::XK_Cyrillic_NJE => VirtualKeyCode::Cyrillic_nje, + //ffi::XK_Serbian_NJE => VirtualKeyCode::Serbian_nje, + //ffi::XK_Serbian_TSHE => VirtualKeyCode::Serbian_tshe, + //ffi::XK_Macedonia_KJE => VirtualKeyCode::Macedonia_kje, + //ffi::XK_Byelorussian_SHORTU => VirtualKeyCode::Byelorussian_shortu, + //ffi::XK_Cyrillic_DZHE => VirtualKeyCode::Cyrillic_dzhe, + //ffi::XK_Serbian_DZE => VirtualKeyCode::Serbian_dze, + //ffi::XK_Cyrillic_yu => VirtualKeyCode::Cyrillic_yu, + //ffi::XK_Cyrillic_a => VirtualKeyCode::Cyrillic_a, + //ffi::XK_Cyrillic_be => VirtualKeyCode::Cyrillic_be, + //ffi::XK_Cyrillic_tse => VirtualKeyCode::Cyrillic_tse, + //ffi::XK_Cyrillic_de => VirtualKeyCode::Cyrillic_de, + //ffi::XK_Cyrillic_ie => VirtualKeyCode::Cyrillic_ie, + //ffi::XK_Cyrillic_ef => VirtualKeyCode::Cyrillic_ef, + //ffi::XK_Cyrillic_ghe => VirtualKeyCode::Cyrillic_ghe, + //ffi::XK_Cyrillic_ha => VirtualKeyCode::Cyrillic_ha, + //ffi::XK_Cyrillic_i => VirtualKeyCode::Cyrillic_i, + //ffi::XK_Cyrillic_shorti => VirtualKeyCode::Cyrillic_shorti, + //ffi::XK_Cyrillic_ka => VirtualKeyCode::Cyrillic_ka, + //ffi::XK_Cyrillic_el => VirtualKeyCode::Cyrillic_el, + //ffi::XK_Cyrillic_em => VirtualKeyCode::Cyrillic_em, + //ffi::XK_Cyrillic_en => VirtualKeyCode::Cyrillic_en, + //ffi::XK_Cyrillic_o => VirtualKeyCode::Cyrillic_o, + //ffi::XK_Cyrillic_pe => VirtualKeyCode::Cyrillic_pe, + //ffi::XK_Cyrillic_ya => VirtualKeyCode::Cyrillic_ya, + //ffi::XK_Cyrillic_er => VirtualKeyCode::Cyrillic_er, + //ffi::XK_Cyrillic_es => VirtualKeyCode::Cyrillic_es, + //ffi::XK_Cyrillic_te => VirtualKeyCode::Cyrillic_te, + //ffi::XK_Cyrillic_u => VirtualKeyCode::Cyrillic_u, + //ffi::XK_Cyrillic_zhe => VirtualKeyCode::Cyrillic_zhe, + //ffi::XK_Cyrillic_ve => VirtualKeyCode::Cyrillic_ve, + //ffi::XK_Cyrillic_softsign => VirtualKeyCode::Cyrillic_softsign, + //ffi::XK_Cyrillic_yeru => VirtualKeyCode::Cyrillic_yeru, + //ffi::XK_Cyrillic_ze => VirtualKeyCode::Cyrillic_ze, + //ffi::XK_Cyrillic_sha => VirtualKeyCode::Cyrillic_sha, + //ffi::XK_Cyrillic_e => VirtualKeyCode::Cyrillic_e, + //ffi::XK_Cyrillic_shcha => VirtualKeyCode::Cyrillic_shcha, + //ffi::XK_Cyrillic_che => VirtualKeyCode::Cyrillic_che, + //ffi::XK_Cyrillic_hardsign => VirtualKeyCode::Cyrillic_hardsign, + //ffi::XK_Cyrillic_YU => VirtualKeyCode::Cyrillic_yu, + //ffi::XK_Cyrillic_A => VirtualKeyCode::Cyrillic_a, + //ffi::XK_Cyrillic_BE => VirtualKeyCode::Cyrillic_be, + //ffi::XK_Cyrillic_TSE => VirtualKeyCode::Cyrillic_tse, + //ffi::XK_Cyrillic_DE => VirtualKeyCode::Cyrillic_de, + //ffi::XK_Cyrillic_IE => VirtualKeyCode::Cyrillic_ie, + //ffi::XK_Cyrillic_EF => VirtualKeyCode::Cyrillic_ef, + //ffi::XK_Cyrillic_GHE => VirtualKeyCode::Cyrillic_ghe, + //ffi::XK_Cyrillic_HA => VirtualKeyCode::Cyrillic_ha, + //ffi::XK_Cyrillic_I => VirtualKeyCode::Cyrillic_i, + //ffi::XK_Cyrillic_SHORTI => VirtualKeyCode::Cyrillic_shorti, + //ffi::XK_Cyrillic_KA => VirtualKeyCode::Cyrillic_ka, + //ffi::XK_Cyrillic_EL => VirtualKeyCode::Cyrillic_el, + //ffi::XK_Cyrillic_EM => VirtualKeyCode::Cyrillic_em, + //ffi::XK_Cyrillic_EN => VirtualKeyCode::Cyrillic_en, + //ffi::XK_Cyrillic_O => VirtualKeyCode::Cyrillic_o, + //ffi::XK_Cyrillic_PE => VirtualKeyCode::Cyrillic_pe, + //ffi::XK_Cyrillic_YA => VirtualKeyCode::Cyrillic_ya, + //ffi::XK_Cyrillic_ER => VirtualKeyCode::Cyrillic_er, + //ffi::XK_Cyrillic_ES => VirtualKeyCode::Cyrillic_es, + //ffi::XK_Cyrillic_TE => VirtualKeyCode::Cyrillic_te, + //ffi::XK_Cyrillic_U => VirtualKeyCode::Cyrillic_u, + //ffi::XK_Cyrillic_ZHE => VirtualKeyCode::Cyrillic_zhe, + //ffi::XK_Cyrillic_VE => VirtualKeyCode::Cyrillic_ve, + //ffi::XK_Cyrillic_SOFTSIGN => VirtualKeyCode::Cyrillic_softsign, + //ffi::XK_Cyrillic_YERU => VirtualKeyCode::Cyrillic_yeru, + //ffi::XK_Cyrillic_ZE => VirtualKeyCode::Cyrillic_ze, + //ffi::XK_Cyrillic_SHA => VirtualKeyCode::Cyrillic_sha, + //ffi::XK_Cyrillic_E => VirtualKeyCode::Cyrillic_e, + //ffi::XK_Cyrillic_SHCHA => VirtualKeyCode::Cyrillic_shcha, + //ffi::XK_Cyrillic_CHE => VirtualKeyCode::Cyrillic_che, + //ffi::XK_Cyrillic_HARDSIGN => VirtualKeyCode::Cyrillic_hardsign, + //ffi::XK_Greek_ALPHAaccent => VirtualKeyCode::Greek_alphaaccent, + //ffi::XK_Greek_EPSILONaccent => VirtualKeyCode::Greek_epsilonaccent, + //ffi::XK_Greek_ETAaccent => VirtualKeyCode::Greek_etaaccent, + //ffi::XK_Greek_IOTAaccent => VirtualKeyCode::Greek_iotaaccent, + //ffi::XK_Greek_IOTAdiaeresis => VirtualKeyCode::Greek_iotadiaeresis, + //ffi::XK_Greek_OMICRONaccent => VirtualKeyCode::Greek_omicronaccent, + //ffi::XK_Greek_UPSILONaccent => VirtualKeyCode::Greek_upsilonaccent, + //ffi::XK_Greek_UPSILONdieresis => VirtualKeyCode::Greek_upsilondieresis, + //ffi::XK_Greek_OMEGAaccent => VirtualKeyCode::Greek_omegaaccent, + //ffi::XK_Greek_accentdieresis => VirtualKeyCode::Greek_accentdieresis, + //ffi::XK_Greek_horizbar => VirtualKeyCode::Greek_horizbar, + //ffi::XK_Greek_alphaaccent => VirtualKeyCode::Greek_alphaaccent, + //ffi::XK_Greek_epsilonaccent => VirtualKeyCode::Greek_epsilonaccent, + //ffi::XK_Greek_etaaccent => VirtualKeyCode::Greek_etaaccent, + //ffi::XK_Greek_iotaaccent => VirtualKeyCode::Greek_iotaaccent, + //ffi::XK_Greek_iotadieresis => VirtualKeyCode::Greek_iotadieresis, + //ffi::XK_Greek_iotaaccentdieresis => VirtualKeyCode::Greek_iotaaccentdieresis, + //ffi::XK_Greek_omicronaccent => VirtualKeyCode::Greek_omicronaccent, + //ffi::XK_Greek_upsilonaccent => VirtualKeyCode::Greek_upsilonaccent, + //ffi::XK_Greek_upsilondieresis => VirtualKeyCode::Greek_upsilondieresis, + //ffi::XK_Greek_upsilonaccentdieresis => VirtualKeyCode::Greek_upsilonaccentdieresis, + //ffi::XK_Greek_omegaaccent => VirtualKeyCode::Greek_omegaaccent, + //ffi::XK_Greek_ALPHA => VirtualKeyCode::Greek_alpha, + //ffi::XK_Greek_BETA => VirtualKeyCode::Greek_beta, + //ffi::XK_Greek_GAMMA => VirtualKeyCode::Greek_gamma, + //ffi::XK_Greek_DELTA => VirtualKeyCode::Greek_delta, + //ffi::XK_Greek_EPSILON => VirtualKeyCode::Greek_epsilon, + //ffi::XK_Greek_ZETA => VirtualKeyCode::Greek_zeta, + //ffi::XK_Greek_ETA => VirtualKeyCode::Greek_eta, + //ffi::XK_Greek_THETA => VirtualKeyCode::Greek_theta, + //ffi::XK_Greek_IOTA => VirtualKeyCode::Greek_iota, + //ffi::XK_Greek_KAPPA => VirtualKeyCode::Greek_kappa, + //ffi::XK_Greek_LAMDA => VirtualKeyCode::Greek_lamda, + //ffi::XK_Greek_LAMBDA => VirtualKeyCode::Greek_lambda, + //ffi::XK_Greek_MU => VirtualKeyCode::Greek_mu, + //ffi::XK_Greek_NU => VirtualKeyCode::Greek_nu, + //ffi::XK_Greek_XI => VirtualKeyCode::Greek_xi, + //ffi::XK_Greek_OMICRON => VirtualKeyCode::Greek_omicron, + //ffi::XK_Greek_PI => VirtualKeyCode::Greek_pi, + //ffi::XK_Greek_RHO => VirtualKeyCode::Greek_rho, + //ffi::XK_Greek_SIGMA => VirtualKeyCode::Greek_sigma, + //ffi::XK_Greek_TAU => VirtualKeyCode::Greek_tau, + //ffi::XK_Greek_UPSILON => VirtualKeyCode::Greek_upsilon, + //ffi::XK_Greek_PHI => VirtualKeyCode::Greek_phi, + //ffi::XK_Greek_CHI => VirtualKeyCode::Greek_chi, + //ffi::XK_Greek_PSI => VirtualKeyCode::Greek_psi, + //ffi::XK_Greek_OMEGA => VirtualKeyCode::Greek_omega, + //ffi::XK_Greek_alpha => VirtualKeyCode::Greek_alpha, + //ffi::XK_Greek_beta => VirtualKeyCode::Greek_beta, + //ffi::XK_Greek_gamma => VirtualKeyCode::Greek_gamma, + //ffi::XK_Greek_delta => VirtualKeyCode::Greek_delta, + //ffi::XK_Greek_epsilon => VirtualKeyCode::Greek_epsilon, + //ffi::XK_Greek_zeta => VirtualKeyCode::Greek_zeta, + //ffi::XK_Greek_eta => VirtualKeyCode::Greek_eta, + //ffi::XK_Greek_theta => VirtualKeyCode::Greek_theta, + //ffi::XK_Greek_iota => VirtualKeyCode::Greek_iota, + //ffi::XK_Greek_kappa => VirtualKeyCode::Greek_kappa, + //ffi::XK_Greek_lamda => VirtualKeyCode::Greek_lamda, + //ffi::XK_Greek_lambda => VirtualKeyCode::Greek_lambda, + //ffi::XK_Greek_mu => VirtualKeyCode::Greek_mu, + //ffi::XK_Greek_nu => VirtualKeyCode::Greek_nu, + //ffi::XK_Greek_xi => VirtualKeyCode::Greek_xi, + //ffi::XK_Greek_omicron => VirtualKeyCode::Greek_omicron, + //ffi::XK_Greek_pi => VirtualKeyCode::Greek_pi, + //ffi::XK_Greek_rho => VirtualKeyCode::Greek_rho, + //ffi::XK_Greek_sigma => VirtualKeyCode::Greek_sigma, + //ffi::XK_Greek_finalsmallsigma => VirtualKeyCode::Greek_finalsmallsigma, + //ffi::XK_Greek_tau => VirtualKeyCode::Greek_tau, + //ffi::XK_Greek_upsilon => VirtualKeyCode::Greek_upsilon, + //ffi::XK_Greek_phi => VirtualKeyCode::Greek_phi, + //ffi::XK_Greek_chi => VirtualKeyCode::Greek_chi, + //ffi::XK_Greek_psi => VirtualKeyCode::Greek_psi, + //ffi::XK_Greek_omega => VirtualKeyCode::Greek_omega, + //ffi::XK_Greek_switch => VirtualKeyCode::Greek_switch, + //ffi::XK_leftradical => VirtualKeyCode::Leftradical, + //ffi::XK_topleftradical => VirtualKeyCode::Topleftradical, + //ffi::XK_horizconnector => VirtualKeyCode::Horizconnector, + //ffi::XK_topintegral => VirtualKeyCode::Topintegral, + //ffi::XK_botintegral => VirtualKeyCode::Botintegral, + //ffi::XK_vertconnector => VirtualKeyCode::Vertconnector, + //ffi::XK_topleftsqbracket => VirtualKeyCode::Topleftsqbracket, + //ffi::XK_botleftsqbracket => VirtualKeyCode::Botleftsqbracket, + //ffi::XK_toprightsqbracket => VirtualKeyCode::Toprightsqbracket, + //ffi::XK_botrightsqbracket => VirtualKeyCode::Botrightsqbracket, + //ffi::XK_topleftparens => VirtualKeyCode::Topleftparens, + //ffi::XK_botleftparens => VirtualKeyCode::Botleftparens, + //ffi::XK_toprightparens => VirtualKeyCode::Toprightparens, + //ffi::XK_botrightparens => VirtualKeyCode::Botrightparens, + //ffi::XK_leftmiddlecurlybrace => VirtualKeyCode::Leftmiddlecurlybrace, + //ffi::XK_rightmiddlecurlybrace => VirtualKeyCode::Rightmiddlecurlybrace, + //ffi::XK_topleftsummation => VirtualKeyCode::Topleftsummation, + //ffi::XK_botleftsummation => VirtualKeyCode::Botleftsummation, + //ffi::XK_topvertsummationconnector => VirtualKeyCode::Topvertsummationconnector, + //ffi::XK_botvertsummationconnector => VirtualKeyCode::Botvertsummationconnector, + //ffi::XK_toprightsummation => VirtualKeyCode::Toprightsummation, + //ffi::XK_botrightsummation => VirtualKeyCode::Botrightsummation, + //ffi::XK_rightmiddlesummation => VirtualKeyCode::Rightmiddlesummation, + //ffi::XK_lessthanequal => VirtualKeyCode::Lessthanequal, + //ffi::XK_notequal => VirtualKeyCode::Notequal, + //ffi::XK_greaterthanequal => VirtualKeyCode::Greaterthanequal, + //ffi::XK_integral => VirtualKeyCode::Integral, + //ffi::XK_therefore => VirtualKeyCode::Therefore, + //ffi::XK_variation => VirtualKeyCode::Variation, + //ffi::XK_infinity => VirtualKeyCode::Infinity, + //ffi::XK_nabla => VirtualKeyCode::Nabla, + //ffi::XK_approximate => VirtualKeyCode::Approximate, + //ffi::XK_similarequal => VirtualKeyCode::Similarequal, + //ffi::XK_ifonlyif => VirtualKeyCode::Ifonlyif, + //ffi::XK_implies => VirtualKeyCode::Implies, + //ffi::XK_identical => VirtualKeyCode::Identical, + //ffi::XK_radical => VirtualKeyCode::Radical, + //ffi::XK_includedin => VirtualKeyCode::Includedin, + //ffi::XK_includes => VirtualKeyCode::Includes, + //ffi::XK_intersection => VirtualKeyCode::Intersection, + //ffi::XK_union => VirtualKeyCode::Union, + //ffi::XK_logicaland => VirtualKeyCode::Logicaland, + //ffi::XK_logicalor => VirtualKeyCode::Logicalor, + //ffi::XK_partialderivative => VirtualKeyCode::Partialderivative, + //ffi::XK_function => VirtualKeyCode::Function, + //ffi::XK_leftarrow => VirtualKeyCode::Leftarrow, + //ffi::XK_uparrow => VirtualKeyCode::Uparrow, + //ffi::XK_rightarrow => VirtualKeyCode::Rightarrow, + //ffi::XK_downarrow => VirtualKeyCode::Downarrow, + //ffi::XK_blank => VirtualKeyCode::Blank, + //ffi::XK_soliddiamond => VirtualKeyCode::Soliddiamond, + //ffi::XK_checkerboard => VirtualKeyCode::Checkerboard, + //ffi::XK_ht => VirtualKeyCode::Ht, + //ffi::XK_ff => VirtualKeyCode::Ff, + //ffi::XK_cr => VirtualKeyCode::Cr, + //ffi::XK_lf => VirtualKeyCode::Lf, + //ffi::XK_nl => VirtualKeyCode::Nl, + //ffi::XK_vt => VirtualKeyCode::Vt, + //ffi::XK_lowrightcorner => VirtualKeyCode::Lowrightcorner, + //ffi::XK_uprightcorner => VirtualKeyCode::Uprightcorner, + //ffi::XK_upleftcorner => VirtualKeyCode::Upleftcorner, + //ffi::XK_lowleftcorner => VirtualKeyCode::Lowleftcorner, + //ffi::XK_crossinglines => VirtualKeyCode::Crossinglines, + //ffi::XK_horizlinescan1 => VirtualKeyCode::Horizlinescan1, + //ffi::XK_horizlinescan3 => VirtualKeyCode::Horizlinescan3, + //ffi::XK_horizlinescan5 => VirtualKeyCode::Horizlinescan5, + //ffi::XK_horizlinescan7 => VirtualKeyCode::Horizlinescan7, + //ffi::XK_horizlinescan9 => VirtualKeyCode::Horizlinescan9, + //ffi::XK_leftt => VirtualKeyCode::Leftt, + //ffi::XK_rightt => VirtualKeyCode::Rightt, + //ffi::XK_bott => VirtualKeyCode::Bott, + //ffi::XK_topt => VirtualKeyCode::Topt, + //ffi::XK_vertbar => VirtualKeyCode::Vertbar, + //ffi::XK_emspace => VirtualKeyCode::Emspace, + //ffi::XK_enspace => VirtualKeyCode::Enspace, + //ffi::XK_em3space => VirtualKeyCode::Em3space, + //ffi::XK_em4space => VirtualKeyCode::Em4space, + //ffi::XK_digitspace => VirtualKeyCode::Digitspace, + //ffi::XK_punctspace => VirtualKeyCode::Punctspace, + //ffi::XK_thinspace => VirtualKeyCode::Thinspace, + //ffi::XK_hairspace => VirtualKeyCode::Hairspace, + //ffi::XK_emdash => VirtualKeyCode::Emdash, + //ffi::XK_endash => VirtualKeyCode::Endash, + //ffi::XK_signifblank => VirtualKeyCode::Signifblank, + //ffi::XK_ellipsis => VirtualKeyCode::Ellipsis, + //ffi::XK_doubbaselinedot => VirtualKeyCode::Doubbaselinedot, + //ffi::XK_onethird => VirtualKeyCode::Onethird, + //ffi::XK_twothirds => VirtualKeyCode::Twothirds, + //ffi::XK_onefifth => VirtualKeyCode::Onefifth, + //ffi::XK_twofifths => VirtualKeyCode::Twofifths, + //ffi::XK_threefifths => VirtualKeyCode::Threefifths, + //ffi::XK_fourfifths => VirtualKeyCode::Fourfifths, + //ffi::XK_onesixth => VirtualKeyCode::Onesixth, + //ffi::XK_fivesixths => VirtualKeyCode::Fivesixths, + //ffi::XK_careof => VirtualKeyCode::Careof, + //ffi::XK_figdash => VirtualKeyCode::Figdash, + //ffi::XK_leftanglebracket => VirtualKeyCode::Leftanglebracket, + //ffi::XK_decimalpoint => VirtualKeyCode::Decimalpoint, + //ffi::XK_rightanglebracket => VirtualKeyCode::Rightanglebracket, + //ffi::XK_marker => VirtualKeyCode::Marker, + //ffi::XK_oneeighth => VirtualKeyCode::Oneeighth, + //ffi::XK_threeeighths => VirtualKeyCode::Threeeighths, + //ffi::XK_fiveeighths => VirtualKeyCode::Fiveeighths, + //ffi::XK_seveneighths => VirtualKeyCode::Seveneighths, + //ffi::XK_trademark => VirtualKeyCode::Trademark, + //ffi::XK_signaturemark => VirtualKeyCode::Signaturemark, + //ffi::XK_trademarkincircle => VirtualKeyCode::Trademarkincircle, + //ffi::XK_leftopentriangle => VirtualKeyCode::Leftopentriangle, + //ffi::XK_rightopentriangle => VirtualKeyCode::Rightopentriangle, + //ffi::XK_emopencircle => VirtualKeyCode::Emopencircle, + //ffi::XK_emopenrectangle => VirtualKeyCode::Emopenrectangle, + //ffi::XK_leftsinglequotemark => VirtualKeyCode::Leftsinglequotemark, + //ffi::XK_rightsinglequotemark => VirtualKeyCode::Rightsinglequotemark, + //ffi::XK_leftdoublequotemark => VirtualKeyCode::Leftdoublequotemark, + //ffi::XK_rightdoublequotemark => VirtualKeyCode::Rightdoublequotemark, + //ffi::XK_prescription => VirtualKeyCode::Prescription, + //ffi::XK_minutes => VirtualKeyCode::Minutes, + //ffi::XK_seconds => VirtualKeyCode::Seconds, + //ffi::XK_latincross => VirtualKeyCode::Latincross, + //ffi::XK_hexagram => VirtualKeyCode::Hexagram, + //ffi::XK_filledrectbullet => VirtualKeyCode::Filledrectbullet, + //ffi::XK_filledlefttribullet => VirtualKeyCode::Filledlefttribullet, + //ffi::XK_filledrighttribullet => VirtualKeyCode::Filledrighttribullet, + //ffi::XK_emfilledcircle => VirtualKeyCode::Emfilledcircle, + //ffi::XK_emfilledrect => VirtualKeyCode::Emfilledrect, + //ffi::XK_enopencircbullet => VirtualKeyCode::Enopencircbullet, + //ffi::XK_enopensquarebullet => VirtualKeyCode::Enopensquarebullet, + //ffi::XK_openrectbullet => VirtualKeyCode::Openrectbullet, + //ffi::XK_opentribulletup => VirtualKeyCode::Opentribulletup, + //ffi::XK_opentribulletdown => VirtualKeyCode::Opentribulletdown, + //ffi::XK_openstar => VirtualKeyCode::Openstar, + //ffi::XK_enfilledcircbullet => VirtualKeyCode::Enfilledcircbullet, + //ffi::XK_enfilledsqbullet => VirtualKeyCode::Enfilledsqbullet, + //ffi::XK_filledtribulletup => VirtualKeyCode::Filledtribulletup, + //ffi::XK_filledtribulletdown => VirtualKeyCode::Filledtribulletdown, + //ffi::XK_leftpointer => VirtualKeyCode::Leftpointer, + //ffi::XK_rightpointer => VirtualKeyCode::Rightpointer, + //ffi::XK_club => VirtualKeyCode::Club, + //ffi::XK_diamond => VirtualKeyCode::Diamond, + //ffi::XK_heart => VirtualKeyCode::Heart, + //ffi::XK_maltesecross => VirtualKeyCode::Maltesecross, + //ffi::XK_dagger => VirtualKeyCode::Dagger, + //ffi::XK_doubledagger => VirtualKeyCode::Doubledagger, + //ffi::XK_checkmark => VirtualKeyCode::Checkmark, + //ffi::XK_ballotcross => VirtualKeyCode::Ballotcross, + //ffi::XK_musicalsharp => VirtualKeyCode::Musicalsharp, + //ffi::XK_musicalflat => VirtualKeyCode::Musicalflat, + //ffi::XK_malesymbol => VirtualKeyCode::Malesymbol, + //ffi::XK_femalesymbol => VirtualKeyCode::Femalesymbol, + //ffi::XK_telephone => VirtualKeyCode::Telephone, + //ffi::XK_telephonerecorder => VirtualKeyCode::Telephonerecorder, + //ffi::XK_phonographcopyright => VirtualKeyCode::Phonographcopyright, + //ffi::XK_caret => VirtualKeyCode::Caret, + //ffi::XK_singlelowquotemark => VirtualKeyCode::Singlelowquotemark, + //ffi::XK_doublelowquotemark => VirtualKeyCode::Doublelowquotemark, + //ffi::XK_cursor => VirtualKeyCode::Cursor, + //ffi::XK_leftcaret => VirtualKeyCode::Leftcaret, + //ffi::XK_rightcaret => VirtualKeyCode::Rightcaret, + //ffi::XK_downcaret => VirtualKeyCode::Downcaret, + //ffi::XK_upcaret => VirtualKeyCode::Upcaret, + //ffi::XK_overbar => VirtualKeyCode::Overbar, + //ffi::XK_downtack => VirtualKeyCode::Downtack, + //ffi::XK_upshoe => VirtualKeyCode::Upshoe, + //ffi::XK_downstile => VirtualKeyCode::Downstile, + //ffi::XK_underbar => VirtualKeyCode::Underbar, + //ffi::XK_jot => VirtualKeyCode::Jot, + //ffi::XK_quad => VirtualKeyCode::Quad, + //ffi::XK_uptack => VirtualKeyCode::Uptack, + //ffi::XK_circle => VirtualKeyCode::Circle, + //ffi::XK_upstile => VirtualKeyCode::Upstile, + //ffi::XK_downshoe => VirtualKeyCode::Downshoe, + //ffi::XK_rightshoe => VirtualKeyCode::Rightshoe, + //ffi::XK_leftshoe => VirtualKeyCode::Leftshoe, + //ffi::XK_lefttack => VirtualKeyCode::Lefttack, + //ffi::XK_righttack => VirtualKeyCode::Righttack, + //ffi::XK_hebrew_doublelowline => VirtualKeyCode::Hebrew_doublelowline, + //ffi::XK_hebrew_aleph => VirtualKeyCode::Hebrew_aleph, + //ffi::XK_hebrew_bet => VirtualKeyCode::Hebrew_bet, + //ffi::XK_hebrew_beth => VirtualKeyCode::Hebrew_beth, + //ffi::XK_hebrew_gimel => VirtualKeyCode::Hebrew_gimel, + //ffi::XK_hebrew_gimmel => VirtualKeyCode::Hebrew_gimmel, + //ffi::XK_hebrew_dalet => VirtualKeyCode::Hebrew_dalet, + //ffi::XK_hebrew_daleth => VirtualKeyCode::Hebrew_daleth, + //ffi::XK_hebrew_he => VirtualKeyCode::Hebrew_he, + //ffi::XK_hebrew_waw => VirtualKeyCode::Hebrew_waw, + //ffi::XK_hebrew_zain => VirtualKeyCode::Hebrew_zain, + //ffi::XK_hebrew_zayin => VirtualKeyCode::Hebrew_zayin, + //ffi::XK_hebrew_chet => VirtualKeyCode::Hebrew_chet, + //ffi::XK_hebrew_het => VirtualKeyCode::Hebrew_het, + //ffi::XK_hebrew_tet => VirtualKeyCode::Hebrew_tet, + //ffi::XK_hebrew_teth => VirtualKeyCode::Hebrew_teth, + //ffi::XK_hebrew_yod => VirtualKeyCode::Hebrew_yod, + //ffi::XK_hebrew_finalkaph => VirtualKeyCode::Hebrew_finalkaph, + //ffi::XK_hebrew_kaph => VirtualKeyCode::Hebrew_kaph, + //ffi::XK_hebrew_lamed => VirtualKeyCode::Hebrew_lamed, + //ffi::XK_hebrew_finalmem => VirtualKeyCode::Hebrew_finalmem, + //ffi::XK_hebrew_mem => VirtualKeyCode::Hebrew_mem, + //ffi::XK_hebrew_finalnun => VirtualKeyCode::Hebrew_finalnun, + //ffi::XK_hebrew_nun => VirtualKeyCode::Hebrew_nun, + //ffi::XK_hebrew_samech => VirtualKeyCode::Hebrew_samech, + //ffi::XK_hebrew_samekh => VirtualKeyCode::Hebrew_samekh, + //ffi::XK_hebrew_ayin => VirtualKeyCode::Hebrew_ayin, + //ffi::XK_hebrew_finalpe => VirtualKeyCode::Hebrew_finalpe, + //ffi::XK_hebrew_pe => VirtualKeyCode::Hebrew_pe, + //ffi::XK_hebrew_finalzade => VirtualKeyCode::Hebrew_finalzade, + //ffi::XK_hebrew_finalzadi => VirtualKeyCode::Hebrew_finalzadi, + //ffi::XK_hebrew_zade => VirtualKeyCode::Hebrew_zade, + //ffi::XK_hebrew_zadi => VirtualKeyCode::Hebrew_zadi, + //ffi::XK_hebrew_qoph => VirtualKeyCode::Hebrew_qoph, + //ffi::XK_hebrew_kuf => VirtualKeyCode::Hebrew_kuf, + //ffi::XK_hebrew_resh => VirtualKeyCode::Hebrew_resh, + //ffi::XK_hebrew_shin => VirtualKeyCode::Hebrew_shin, + //ffi::XK_hebrew_taw => VirtualKeyCode::Hebrew_taw, + //ffi::XK_hebrew_taf => VirtualKeyCode::Hebrew_taf, + //ffi::XK_Hebrew_switch => VirtualKeyCode::Hebrew_switch, ffi::XF86XK_Back => VirtualKeyCode::NavigateBackward, ffi::XF86XK_Forward => VirtualKeyCode::NavigateForward, ffi::XF86XK_Copy => VirtualKeyCode::Copy, diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index 1cd1bd561b..e3a9352f0d 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -31,50 +31,47 @@ use std::sync::atomic::{self, AtomicBool}; use libc::{self, setlocale, LC_CTYPE}; -use { - ControlFlow, - CreationError, - DeviceEvent, - Event, - EventLoopClosed, - KeyboardInput, - LogicalPosition, - LogicalSize, - WindowAttributes, - WindowEvent, -}; -use events::ModifiersState; +use event_loop::{ControlFlow, EventLoopClosed, EventLoopWindowTarget as RootELW}; +use event::{DeviceEvent, Event, KeyboardInput, ModifiersState, WindowEvent}; use platform_impl::PlatformSpecificWindowBuilderAttributes; +use dpi::{LogicalPosition,LogicalSize}; +use window::{CreationError, WindowAttributes}; use self::dnd::{Dnd, DndState}; use self::ime::{ImeReceiver, ImeSender, ImeCreationError, Ime}; -pub struct EventLoop { +pub struct EventLoopWindowTarget { xconn: Arc, wm_delete_window: ffi::Atom, - dnd: Dnd, - ime_receiver: ImeReceiver, ime_sender: ImeSender, + root: ffi::Window, ime: RefCell, - randr_event_offset: c_int, windows: RefCell>>, + _marker: ::std::marker::PhantomData +} + +pub struct EventLoop { + dnd: Dnd, + ime_receiver: ImeReceiver, + randr_event_offset: c_int, devices: RefCell>, xi2ext: XExtension, pending_wakeup: Arc, - root: ffi::Window, // A dummy, `InputOnly` window that we can use to receive wakeup events and interrupt blocking // `XNextEvent` calls. wakeup_dummy_window: ffi::Window, + target: RootELW } #[derive(Clone)] -pub struct EventLoopProxy { +pub struct EventLoopProxy { pending_wakeup: Weak, xconn: Weak, wakeup_dummy_window: ffi::Window, + _marker: ::std::marker::PhantomData } -impl EventLoop { - pub fn new(xconn: Arc) -> EventLoop { +impl EventLoop { + pub fn new(xconn: Arc) -> EventLoop { let root = unsafe { (xconn.xlib.XDefaultRootWindow)(xconn.display) }; let wm_delete_window = unsafe { xconn.get_atom_unchecked(b"WM_DELETE_WINDOW\0") }; @@ -150,24 +147,30 @@ impl EventLoop { }; let result = EventLoop { - xconn, - wm_delete_window, dnd, ime_receiver, - ime_sender, - ime, randr_event_offset, - windows: Default::default(), devices: Default::default(), xi2ext, pending_wakeup: Default::default(), - root, wakeup_dummy_window, + target: RootELW{ + p: super::EventLoopWindowTarget::X(EventLoopWindowTarget { + ime, + root, + windows: Default::default(), + _marker: ::std::marker::PhantomData, + ime_sender, + xconn, + wm_delete_window, + }), + _marker: ::std::marker::PhantomData + } }; // Register for device hotplug events // (The request buffer is flushed during `init_device`) - result.xconn.select_xinput_events( + get_xtarget(&result.target).xconn.select_xinput_events( root, ffi::XIAllDevices, ffi::XI_HierarchyChangedMask, @@ -181,18 +184,21 @@ impl EventLoop { /// Returns the `XConnection` of this events loop. #[inline] pub fn x_connection(&self) -> &Arc { - &self.xconn + &get_xtarget(&self.target).xconn } - pub fn create_proxy(&self) -> EventLoopProxy { + pub fn create_proxy(&self) -> EventLoopProxy { + let wt = get_xtarget(&self.target); EventLoopProxy { pending_wakeup: Arc::downgrade(&self.pending_wakeup), - xconn: Arc::downgrade(&self.xconn), + xconn: Arc::downgrade(&wt.xconn), wakeup_dummy_window: self.wakeup_dummy_window, + _marker: ::std::marker::PhantomData } } unsafe fn poll_one_event(&mut self, event_ptr : *mut ffi::XEvent) -> bool { + let wt = get_xtarget(&self.target); // This function is used to poll and remove a single event // from the Xlib event queue in a non-blocking, atomic way. // XCheckIfEvent is non-blocking and removes events from queue. @@ -207,8 +213,8 @@ impl EventLoop { 1 } - let result = (self.xconn.xlib.XCheckIfEvent)( - self.xconn.display, + let result = (wt.xconn.xlib.XCheckIfEvent)( + wt.xconn.display, event_ptr, Some(predicate), std::ptr::null_mut()); @@ -217,6 +223,7 @@ impl EventLoop { } unsafe fn wait_for_input(&mut self) { + let wt = get_xtarget(&self.target); // XNextEvent can not be used in multi-threaded applications // because it is blocking for input while holding the global // Xlib mutex. @@ -224,14 +231,14 @@ impl EventLoop { // use select(2) to wait for input to arrive loop { // First use XFlush to flush any buffered x11 requests - (self.xconn.xlib.XFlush)(self.xconn.display); + (wt.xconn.xlib.XFlush)(wt.xconn.display); // Then use select(2) to wait for input data let mut fds : fd_set = mem::uninitialized(); FD_ZERO(&mut fds); - FD_SET(self.xconn.x11_fd, &mut fds); + FD_SET(wt.xconn.x11_fd, &mut fds); let err = select( - self.xconn.x11_fd + 1, + wt.xconn.x11_fd + 1, &mut fds, // read fds std::ptr::null_mut(), // write fds std::ptr::null_mut(), // except fds (could be used to detect errors) @@ -250,67 +257,21 @@ impl EventLoop { panic!("select(2) returned fatal error condition"); } - if FD_ISSET(self.xconn.x11_fd, &mut fds) { - break; - } - } - } - - pub fn poll_events(&mut self, mut callback: F) - where F: FnMut(Event) - { - let mut xev = unsafe { mem::uninitialized() }; - loop { - // Get next event - unsafe { - if !self.poll_one_event(&mut xev) { - break; - } - } - self.process_event(&mut xev, &mut callback); - } - } - - pub fn run_forever(&mut self, mut callback: F) - where F: FnMut(Event) -> ControlFlow - { - let mut xev = unsafe { mem::uninitialized() }; - - loop { - unsafe { - while !self.poll_one_event(&mut xev) { - // block until input is available - self.wait_for_input(); - } - }; - - let mut control_flow = ControlFlow::Continue; - - // Track whether or not `Break` was returned when processing the event. - { - let mut cb = |event| { - if let ControlFlow::Break = callback(event) { - control_flow = ControlFlow::Break; - } - }; - - self.process_event(&mut xev, &mut cb); - } - - if let ControlFlow::Break = control_flow { + if FD_ISSET(wt.xconn.x11_fd, &mut fds) { break; } } } fn process_event(&mut self, xev: &mut ffi::XEvent, mut callback: F) - where F: FnMut(Event) + where F: FnMut(Event) { + let wt = get_xtarget(&self.target); // XFilterEvent tells us when an event has been discarded by the input method. // Specifically, this involves all of the KeyPress events in compose/pre-edit sequences, // along with an extra copy of the KeyRelease events. This also prevents backspace and // arrow keys from being detected twice. - if ffi::True == unsafe { (self.xconn.xlib.XFilterEvent)( + if ffi::True == unsafe { (wt.xconn.xlib.XFilterEvent)( xev, { let xev: &ffi::XAnyEvent = xev.as_ref(); xev.window } ) } { @@ -320,8 +281,8 @@ impl EventLoop { let event_type = xev.get_type(); match event_type { ffi::MappingNotify => { - unsafe { (self.xconn.xlib.XRefreshKeyboardMapping)(xev.as_mut()); } - self.xconn.check_errors().expect("Failed to call XRefreshKeyboardMapping"); + unsafe { (wt.xconn.xlib.XRefreshKeyboardMapping)(xev.as_mut()); } + wt.xconn.check_errors().expect("Failed to call XRefreshKeyboardMapping"); } ffi::ClientMessage => { @@ -330,7 +291,7 @@ impl EventLoop { let window = client_msg.window; let window_id = mkwid(window); - if client_msg.data.get_long(0) as ffi::Atom == self.wm_delete_window { + if client_msg.data.get_long(0) as ffi::Atom == wt.wm_delete_window { callback(Event::WindowEvent { window_id, event: WindowEvent::CloseRequested }); } else if client_msg.message_type == self.dnd.atoms.enter { let source_window = client_msg.data.get_long(0) as c_ulong; @@ -433,7 +394,8 @@ impl EventLoop { }); } else if self.pending_wakeup.load(atomic::Ordering::Relaxed) { self.pending_wakeup.store(false, atomic::Ordering::Relaxed); - callback(Event::Awakened); + // TODO: User event + // callback(Event::Awakened); } } @@ -519,7 +481,7 @@ impl EventLoop { .as_ref() .cloned() .unwrap_or_else(|| { - let frame_extents = self.xconn.get_frame_extents_heuristic(xwindow, self.root); + let frame_extents = wt.xconn.get_frame_extents_heuristic(xwindow, wt.root); shared_state_lock.frame_extents = Some(frame_extents.clone()); frame_extents }); @@ -549,7 +511,7 @@ impl EventLoop { }); let new_hidpi_factor = { let window_rect = util::AaRect::new(new_outer_position, new_inner_size); - monitor = self.xconn.get_monitor_for_window(Some(window_rect)); + monitor = wt.xconn.get_monitor_for_window(Some(window_rect)); let new_hidpi_factor = monitor.hidpi_factor; shared_state_lock.last_monitor = Some(monitor.clone()); new_hidpi_factor @@ -581,8 +543,8 @@ impl EventLoop { shared_state_lock.dpi_adjusted = None; } else { unsafe { - (self.xconn.xlib.XResizeWindow)( - self.xconn.display, + (wt.xconn.xlib.XResizeWindow)( + wt.xconn.display, xwindow, rounded_size.0 as c_uint, rounded_size.1 as c_uint, @@ -621,7 +583,7 @@ impl EventLoop { // (which is almost all of them). Failing to correctly update WM info doesn't // really have much impact, since on the WMs affected (xmonad, dwm, etc.) the only // effect is that we waste some time trying to query unsupported properties. - self.xconn.update_cached_wm_info(self.root); + wt.xconn.update_cached_wm_info(wt.root); self.with_window(xev.window, |window| { window.invalidate_cached_frame_extents(); @@ -636,11 +598,11 @@ impl EventLoop { // In the event that the window's been destroyed without being dropped first, we // cleanup again here. - self.windows.borrow_mut().remove(&WindowId(window)); + wt.windows.borrow_mut().remove(&WindowId(window)); // Since all XIM stuff needs to happen from the same thread, we destroy the input // context here instead of when dropping the window. - self.ime + wt.ime .borrow_mut() .remove_context(window) .expect("Failed to destroy input context"); @@ -654,11 +616,11 @@ impl EventLoop { let window = xev.window; let window_id = mkwid(window); - callback(Event::WindowEvent { window_id, event: WindowEvent::Redraw }); + callback(Event::WindowEvent { window_id, event: WindowEvent::RedrawRequested }); } ffi::KeyPress | ffi::KeyRelease => { - use events::ElementState::{Pressed, Released}; + use event::ElementState::{Pressed, Released}; // Note that in compose/pre-edit sequences, this will always be Released. let state = if xev.get_type() == ffi::KeyPress { @@ -689,14 +651,14 @@ impl EventLoop { let keysym = unsafe { let mut keysym = 0; - (self.xconn.xlib.XLookupString)( + (wt.xconn.xlib.XLookupString)( xkev, ptr::null_mut(), 0, &mut keysym, ptr::null_mut(), ); - self.xconn.check_errors().expect("Failed to lookup keysym"); + wt.xconn.check_errors().expect("Failed to lookup keysym"); keysym }; let virtual_keycode = events::keysym_to_element(keysym as c_uint); @@ -716,8 +678,8 @@ impl EventLoop { } if state == Pressed { - let written = if let Some(ic) = self.ime.borrow().get_context(window) { - self.xconn.lookup_utf8(ic, xkev) + let written = if let Some(ic) = wt.ime.borrow().get_context(window) { + wt.xconn.lookup_utf8(ic, xkev) } else { return; }; @@ -733,17 +695,17 @@ impl EventLoop { } ffi::GenericEvent => { - let guard = if let Some(e) = GenericEventCookie::from_event(&self.xconn, *xev) { e } else { return }; + let guard = if let Some(e) = GenericEventCookie::from_event(&wt.xconn, *xev) { e } else { return }; let xev = &guard.cookie; if self.xi2ext.opcode != xev.extension { return; } - use events::WindowEvent::{Focused, CursorEntered, MouseInput, CursorLeft, CursorMoved, MouseWheel, AxisMotion}; - use events::ElementState::{Pressed, Released}; - use events::MouseButton::{Left, Right, Middle, Other}; - use events::MouseScrollDelta::LineDelta; - use events::{Touch, TouchPhase}; + use event::WindowEvent::{Focused, CursorEntered, MouseInput, CursorLeft, CursorMoved, MouseWheel, AxisMotion}; + use event::ElementState::{Pressed, Released}; + use event::MouseButton::{Left, Right, Middle, Other}; + use event::MouseScrollDelta::LineDelta; + use event::{Touch, TouchPhase}; match xev.evtype { ffi::XI_ButtonPress | ffi::XI_ButtonRelease => { @@ -917,7 +879,7 @@ impl EventLoop { let window_id = mkwid(xev.event); let device_id = mkdid(xev.deviceid); - if let Some(all_info) = DeviceInfo::get(&self.xconn, ffi::XIAllDevices) { + if let Some(all_info) = DeviceInfo::get(&wt.xconn, ffi::XIAllDevices) { let mut devices = self.devices.borrow_mut(); for device_info in all_info.iter() { if device_info.deviceid == xev.sourceid @@ -953,7 +915,7 @@ impl EventLoop { // This needs to only be done after confirming the window still exists, // since otherwise we risk getting a `BadWindow` error if the window was // dropped with queued events. - let modifiers = self.xconn + let modifiers = wt.xconn .query_pointer(xev.event, xev.deviceid) .expect("Failed to query pointer device") .get_modifier_state(); @@ -992,7 +954,7 @@ impl EventLoop { }; let window_id = mkwid(xev.event); - self.ime + wt.ime .borrow_mut() .focus(xev.event) .expect("Failed to focus input context"); @@ -1023,7 +985,7 @@ impl EventLoop { ffi::XI_FocusOut => { let xev: &ffi::XIFocusOutEvent = unsafe { &*(xev.data as *const _) }; if !self.window_exists(xev.event) { return; } - self.ime + wt.ime .borrow_mut() .unfocus(xev.event) .expect("Failed to unfocus input context"); @@ -1130,13 +1092,13 @@ impl EventLoop { let scancode = (keycode - 8) as u32; let keysym = unsafe { - (self.xconn.xlib.XKeycodeToKeysym)( - self.xconn.display, + (wt.xconn.xlib.XKeycodeToKeysym)( + wt.xconn.display, xev.detail as ffi::KeyCode, 0, ) }; - self.xconn.check_errors().expect("Failed to lookup raw keysym"); + wt.xconn.check_errors().expect("Failed to lookup raw keysym"); let virtual_keycode = events::keysym_to_element(keysym as c_uint); @@ -1178,14 +1140,14 @@ impl EventLoop { // In the future, it would be quite easy to emit monitor hotplug events. let prev_list = monitor::invalidate_cached_monitor_list(); if let Some(prev_list) = prev_list { - let new_list = self.xconn.get_available_monitors(); + let new_list = wt.xconn.get_available_monitors(); for new_monitor in new_list { prev_list .iter() .find(|prev_monitor| prev_monitor.name == new_monitor.name) .map(|prev_monitor| { if new_monitor.hidpi_factor != prev_monitor.hidpi_factor { - for (window_id, window) in self.windows.borrow().iter() { + for (window_id, window) in wt.windows.borrow().iter() { if let Some(window) = window.upgrade() { // Check if the window is on this monitor let monitor = window.get_current_monitor(); @@ -1220,27 +1182,29 @@ impl EventLoop { match self.ime_receiver.try_recv() { Ok((window_id, x, y)) => { - self.ime.borrow_mut().send_xim_spot(window_id, x, y); + wt.ime.borrow_mut().send_xim_spot(window_id, x, y); }, Err(_) => (), } } fn init_device(&self, device: c_int) { + let wt = get_xtarget(&self.target); let mut devices = self.devices.borrow_mut(); - if let Some(info) = DeviceInfo::get(&self.xconn, device) { + if let Some(info) = DeviceInfo::get(&wt.xconn, device) { for info in info.iter() { devices.insert(DeviceId(info.deviceid), Device::new(&self, info)); } } } - fn with_window(&self, window_id: ffi::Window, callback: F) -> Option - where F: Fn(&UnownedWindow) -> T + fn with_window(&self, window_id: ffi::Window, callback: F) -> Option + where F: Fn(&UnownedWindow) -> Ret { let mut deleted = false; let window_id = WindowId(window_id); - let result = self.windows + let wt = get_xtarget(&self.target); + let result = wt.windows .borrow() .get(&window_id) .and_then(|window| { @@ -1251,7 +1215,7 @@ impl EventLoop { .map(|window| callback(&*window)); if deleted { // Garbage collection - self.windows.borrow_mut().remove(&window_id); + wt.windows.borrow_mut().remove(&window_id); } result } @@ -1259,9 +1223,102 @@ impl EventLoop { fn window_exists(&self, window_id: ffi::Window) -> bool { self.with_window(window_id, |_| ()).is_some() } + + pub(crate) fn window_target(&self) -> &RootELW { + &self.target + } + + pub fn run_return(&mut self, mut callback: F) + where F: FnMut(Event, &RootELW, &mut ControlFlow) + { + let mut control_flow = ControlFlow::default(); + + loop { + match control_flow { + ControlFlow::Exit => return, + ControlFlow::Poll => { + + }, + ControlFlow::Wait => { + + }, + ControlFlow::WaitUntil(deadline) => { + + } + } + } + } + + pub fn run(mut self, callback: F) -> ! + where F: 'static + FnMut(Event, &RootELW, &mut ControlFlow) + { + self.run_return(callback); + ::std::process::exit(0); + } + +/* + pub fn poll_events(&mut self, mut callback: F) + where F: FnMut(Event) + { + let mut xev = unsafe { mem::uninitialized() }; + loop { + // Get next event + unsafe { + if !self.poll_one_event(&mut xev) { + break; + } + } + self.process_event(&mut xev, &mut callback); + } + } + + pub fn run_forever(&mut self, mut callback: F) + where F: FnMut(Event) -> ControlFlow + { + let mut xev = unsafe { mem::uninitialized() }; + + loop { + unsafe { + while !self.poll_one_event(&mut xev) { + // block until input is available + self.wait_for_input(); + } + }; + + let mut control_flow = ControlFlow::Poll; + + // Track whether or not `Break` was returned when processing the event. + { + let mut cb = |event| { + if let ControlFlow::Exit = callback(event) { + control_flow = ControlFlow::Exit; + } + }; + + self.process_event(&mut xev, &mut cb); + } + + if let ControlFlow::Exit = control_flow { + break; + } + } + } +*/ +} + +fn get_xtarget(rt: &RootELW) -> &EventLoopWindowTarget { + if let super::EventLoopWindowTarget::X(ref target) = rt.p { + target + } else { + unreachable!(); + } } -impl EventLoopProxy { +impl EventLoopProxy { + pub fn send_event(&self, evt: T) -> Result<(), EventLoopClosed> { + unimplemented!(); + } + pub fn wakeup(&self) -> Result<(), EventLoopClosed> { // Update the `EventLoop`'s `pending_wakeup` flag. let display = match (self.pending_wakeup.upgrade(), self.xconn.upgrade()) { @@ -1360,8 +1417,8 @@ impl Deref for Window { } impl Window { - pub fn new( - event_loop: &EventLoop, + pub fn new( + event_loop: &EventLoopWindowTarget, attribs: WindowAttributes, pl_attribs: PlatformSpecificWindowBuilderAttributes ) -> Result { @@ -1420,8 +1477,8 @@ struct XExtension { first_error_id: c_int, } -fn mkwid(w: ffi::Window) -> ::WindowId { ::WindowId(::platform::WindowId::X(WindowId(w))) } -fn mkdid(w: c_int) -> ::DeviceId { ::DeviceId(::platform::DeviceId::X(DeviceId(w))) } +fn mkwid(w: ffi::Window) -> ::window::WindowId { ::window::WindowId(::platform_impl::WindowId::X(WindowId(w))) } +fn mkdid(w: c_int) -> ::event::DeviceId { ::event::DeviceId(::platform_impl::DeviceId::X(DeviceId(w))) } #[derive(Debug)] struct Device { @@ -1446,10 +1503,12 @@ enum ScrollOrientation { } impl Device { - fn new(el: &EventLoop, info: &ffi::XIDeviceInfo) -> Self { + fn new(el: &EventLoop, info: &ffi::XIDeviceInfo) -> Self { let name = unsafe { CStr::from_ptr(info.name).to_string_lossy() }; let mut scroll_axes = Vec::new(); + let wt = get_xtarget(&el.target); + if Device::physical_device(info) { // Register for global raw events let mask = ffi::XI_RawMotionMask @@ -1458,7 +1517,7 @@ impl Device { | ffi::XI_RawKeyPressMask | ffi::XI_RawKeyReleaseMask; // The request buffer is flushed when we poll for events - el.xconn.select_xinput_events(el.root, info.deviceid, mask).queue(); + wt.xconn.select_xinput_events(wt.root, info.deviceid, mask).queue(); // Identify scroll axes for class_ptr in Device::classes(info) { diff --git a/src/platform_impl/linux/x11/monitor.rs b/src/platform_impl/linux/x11/monitor.rs index 4954980530..9f0d92b703 100644 --- a/src/platform_impl/linux/x11/monitor.rs +++ b/src/platform_impl/linux/x11/monitor.rs @@ -2,7 +2,7 @@ use std::os::raw::*; use parking_lot::Mutex; -use {PhysicalPosition, PhysicalSize}; +use dpi::{PhysicalPosition, PhysicalSize}; use super::{util, XConnection, XError}; use super::ffi::{ RRCrtcChangeNotifyMask, diff --git a/src/platform_impl/linux/x11/util/geometry.rs b/src/platform_impl/linux/x11/util/geometry.rs index 1a85b1c868..635552c7b6 100644 --- a/src/platform_impl/linux/x11/util/geometry.rs +++ b/src/platform_impl/linux/x11/util/geometry.rs @@ -1,7 +1,7 @@ use std::cmp; use super::*; -use {LogicalPosition, LogicalSize}; +use dpi::{LogicalPosition, LogicalSize}; // Friendly neighborhood axis-aligned rectangle #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/src/platform_impl/linux/x11/util/icon.rs b/src/platform_impl/linux/x11/util/icon.rs index c19b52a8a8..9bcaf952d5 100644 --- a/src/platform_impl/linux/x11/util/icon.rs +++ b/src/platform_impl/linux/x11/util/icon.rs @@ -1,4 +1,4 @@ -use {Icon, Pixel, PIXEL_SIZE}; +use window::{Icon, Pixel, PIXEL_SIZE}; use super::*; impl Pixel { diff --git a/src/platform_impl/linux/x11/util/input.rs b/src/platform_impl/linux/x11/util/input.rs index 4b75df24bb..aa530e7708 100644 --- a/src/platform_impl/linux/x11/util/input.rs +++ b/src/platform_impl/linux/x11/util/input.rs @@ -1,7 +1,7 @@ use std::str; use super::*; -use events::ModifiersState; +use event::ModifiersState; pub const VIRTUAL_CORE_POINTER: c_int = 2; pub const VIRTUAL_CORE_KEYBOARD: c_int = 3; diff --git a/src/platform_impl/linux/x11/util/randr.rs b/src/platform_impl/linux/x11/util/randr.rs index 5054dbdb01..a07c8257a7 100644 --- a/src/platform_impl/linux/x11/util/randr.rs +++ b/src/platform_impl/linux/x11/util/randr.rs @@ -1,7 +1,7 @@ use std::{env, slice}; use std::str::FromStr; -use validate_hidpi_factor; +use dpi::validate_hidpi_factor; use super::*; pub fn calc_dpi_factor( diff --git a/src/platform_impl/linux/x11/window.rs b/src/platform_impl/linux/x11/window.rs index db82e0e2a0..af6556a60f 100644 --- a/src/platform_impl/linux/x11/window.rs +++ b/src/platform_impl/linux/x11/window.rs @@ -7,15 +7,15 @@ use std::sync::Arc; use libc; use parking_lot::Mutex; -use {Icon, MouseCursor, WindowAttributes}; -use CreationError::{self, OsError}; +use window::{Icon, MouseCursor, WindowAttributes}; +use window::CreationError::{self, OsError}; use dpi::{LogicalPosition, LogicalSize}; use platform_impl::MonitorHandle as PlatformMonitorHandle; use platform_impl::PlatformSpecificWindowBuilderAttributes; use platform_impl::x11::MonitorHandle as X11MonitorHandle; -use window::MonitorHandle as RootMonitorHandle; +use monitor::MonitorHandle as RootMonitorHandle; -use super::{ffi, util, ImeSender, XConnection, XError, WindowId, EventLoop}; +use super::{ffi, util, ImeSender, XConnection, XError, WindowId, EventLoopWindowTarget}; unsafe extern "C" fn visibility_predicate( _display: *mut ffi::Display, @@ -69,8 +69,8 @@ pub struct UnownedWindow { } impl UnownedWindow { - pub fn new( - event_loop: &EventLoop, + pub fn new( + event_loop: &EventLoopWindowTarget, window_attrs: WindowAttributes, pl_attribs: PlatformSpecificWindowBuilderAttributes, ) -> Result { @@ -1210,4 +1210,9 @@ impl UnownedWindow { #[inline] pub fn id(&self) -> WindowId { WindowId(self.xwindow) } + + #[inline] + pub fn request_redraw(&self) { + unimplemented!(); + } }