Files
pipewire-soundpad/src/gui/input.rs
T
2025-09-24 22:51:34 +03:00

25 lines
679 B
Rust

use crate::gui::SoundpadGui;
use egui::{Context, Key};
impl SoundpadGui {
pub fn handle_input(&mut self, ctx: &Context) {
ctx.input(|i| {
if i.key_pressed(Key::Escape) {
std::process::exit(0);
}
if !self.app_state.show_settings && i.key_pressed(Key::Space) {
self.play_toggle();
}
if i.key_pressed(Key::Slash) {
self.app_state.show_settings = !self.app_state.show_settings;
}
if self.app_state.show_settings && i.key_pressed(Key::Backspace) {
self.app_state.show_settings = false;
}
});
}
}