diff --git a/src/input/input_manager.rs b/src/input/input_manager.rs deleted file mode 100644 index 40eff9a..0000000 --- a/src/input/input_manager.rs +++ /dev/null @@ -1,8 +0,0 @@ -use crate::input::Keyboard; - -use wlroots::input; - -pub fn input_manager() -> input::manager::Builder { - input::manager::Builder::default() - .keyboard_added(|_compositor_handle, _keyboard_handle| Some(Box::new(Keyboard))) -} diff --git a/src/input/manager.rs b/src/input/manager.rs new file mode 100644 index 0000000..89f6efd --- /dev/null +++ b/src/input/manager.rs @@ -0,0 +1,17 @@ +use crate::input::Keyboard; + +use wlroots::{ + compositor, + input::{self, keyboard}, +}; + +pub fn manager() -> input::manager::Builder { + input::manager::Builder::default().keyboard_added(keyboard_added) +} + +fn keyboard_added( + _compositor_handle: compositor::Handle, + _keyboard_handle: keyboard::Handle, +) -> Option> { + Some(Box::new(Keyboard)) +} diff --git a/src/input/mod.rs b/src/input/mod.rs index c52eb78..a261e73 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1,5 +1,5 @@ -mod input_manager; +mod manager; mod keyboard; -pub use self::input_manager::*; +pub use self::manager::*; pub use self::keyboard::*; diff --git a/src/main.rs b/src/main.rs index ecf62c0..76b75ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,6 @@ fn build_compositor() -> compositor::Compositor { compositor::Builder::new() .gles2(true) .data_device(true) - .input_manager(input::input_manager()) + .input_manager(input::manager()) .build_auto(()) }