Exit on esc up

This commit is contained in:
2025-05-13 13:53:02 -07:00
parent 1efb3f661b
commit a1aa3bc2eb
4 changed files with 76 additions and 23 deletions

View File

@@ -75,6 +75,9 @@ impl WlClient {
if let Some(keymap) = &*self.keymap.lock().unwrap() {
if let Some(keysym) = keymap.get(&(key + 8)) {
if keysym == "ESC" && state == 0 {
self.exit();
}
println!("Received key:\n\t{} {}", keysym, if state == 0 {'↑'} else {'↓'});
} else {
eprintln!("Unrecognized key!");