diff --git a/frontends/sdl/src/main.rs b/frontends/sdl/src/main.rs index 400d0322b7732ad149dc00d789da1ddb55d9135c..0cb02748286865a9baff1fbde5a01e975d7cf62c 100644 --- a/frontends/sdl/src/main.rs +++ b/frontends/sdl/src/main.rs @@ -195,17 +195,19 @@ impl Emulator { Event::KeyDown { keycode: Some(keycode), .. - } => match key_to_pad(keycode) { - Some(key) => self.system.key_press(key), - None => (), - }, + } => { + if let Some(key) = key_to_pad(keycode) { + self.system.key_press(key) + } + } Event::KeyUp { keycode: Some(keycode), .. - } => match key_to_pad(keycode) { - Some(key) => self.system.key_lift(key), - None => (), - }, + } => { + if let Some(key) = key_to_pad(keycode) { + self.system.key_lift(key) + } + } Event::DropFile { filename, .. } => { self.system.reset(); self.system.load_boot_default();