mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
1.0.0 rewrite
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user