From f40ee148ea3d51a1dcd61be2b9bafebbeaf44a35 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Fri, 23 Aug 2019 22:36:23 +0300 Subject: [PATCH] Add sdl2 key mappings Former-commit-id: 9b3aa941ffca9a679d9ce70ca43d6396d4dfe5ff --- src/backend/sdl2_backend.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/sdl2_backend.rs b/src/backend/sdl2_backend.rs index bf0c0d9..9daa65f 100644 --- a/src/backend/sdl2_backend.rs +++ b/src/backend/sdl2_backend.rs @@ -125,6 +125,12 @@ fn keycode_to_keypad(keycode: Keycode) -> Option { Keycode::Down => Some(keypad::Keys::Down), Keycode::Left => Some(keypad::Keys::Left), Keycode::Right => Some(keypad::Keys::Right), + Keycode::Z => Some(keypad::Keys::ButtonB), + Keycode::X => Some(keypad::Keys::ButtonA), + Keycode::Return => Some(keypad::Keys::Start), + Keycode::Space => Some(keypad::Keys::Select), + Keycode::A => Some(keypad::Keys::ButtonL), + Keycode::S => Some(keypad::Keys::ButtonR), _ => None, } }