diff --git a/src/gui.rs b/src/gui.rs index 34a64d6..0a2ff54 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -1,5 +1,6 @@ use iced::widget::{button, column, text}; use iced::{Alignment, Element, Sandbox, Settings}; +use iced_native::Event; pub fn main() -> iced::Result { Main::run(Settings::default()) @@ -11,6 +12,7 @@ struct Main { #[derive(Debug, Clone, Copy)] enum ControllerButton { + EventOccurred(iced_native::Event), Up, Down, Left, @@ -39,7 +41,14 @@ impl Sandbox for Main { } fn update(&mut self, controllerButton: ControllerButton) { - self.ntfy = format!("push a key to bind to {:?}", controllerButton); + match message { + ControllerButton::EventOccurred(Event) => { + Err(String::from("ohno")).unwrap(); + }, + _ => { + self.ntfy = format!("push a key to bind to {:?}", controllerButton); + }, + } } fn view(&self) -> Element {