diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-09 14:21:29 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-08-10 14:50:51 +0400 |
| commit | 0047272673f8cc3679299b2626a526b9a329b7de (patch) | |
| tree | 4f8398eafd7aa9cb4b0325fadb1568f274983ecc /src/input.rs | |
| parent | 7527cad20035c87255826ee276658b0b89d58f7f (diff) | |
| download | niri-0047272673f8cc3679299b2626a526b9a329b7de.tar.gz niri-0047272673f8cc3679299b2626a526b9a329b7de.tar.bz2 niri-0047272673f8cc3679299b2626a526b9a329b7de.zip | |
Implement TTY switching
Having to pass backend around turns out to be a problem...
Diffstat (limited to 'src/input.rs')
| -rw-r--r-- | src/input.rs | 10 |
1 files changed, 8 insertions, 2 deletions
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<I: InputBackend>(&mut self, event: InputEvent<I>) { + pub fn process_input_event<I: InputBackend>( + &mut self, + change_vt: &mut dyn FnMut(i32), + event: InputEvent<I>, + ) { 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); + } } } } |
