From 0047272673f8cc3679299b2626a526b9a329b7de Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 9 Aug 2023 14:21:29 +0400 Subject: Implement TTY switching Having to pass backend around turns out to be a problem... --- src/input.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/input.rs') diff --git a/src/input.rs b/src/input.rs index ad182645..f2a91082 100644 --- a/src/input.rs +++ b/src/input.rs @@ -15,7 +15,11 @@ enum InputAction { } impl Niri { - pub fn process_input_event(&mut self, event: InputEvent) { + pub fn process_input_event( + &mut self, + change_vt: &mut dyn FnMut(i32), + event: InputEvent, + ) { trace!("process_input_event"); match event { @@ -45,7 +49,9 @@ impl Niri { info!("quitting because Esc was pressed"); self.stop_signal.stop() } - InputAction::ChangeVt(vt) => todo!(), + InputAction::ChangeVt(vt) => { + (*change_vt)(vt); + } } } } -- cgit