mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
25 lines
679 B
Rust
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;
|
|
}
|
|
});
|
|
}
|
|
}
|