Add sdl2 key mappings

Former-commit-id: 9b3aa941ffca9a679d9ce70ca43d6396d4dfe5ff
This commit is contained in:
Michel Heily 2019-08-23 22:36:23 +03:00
parent 4a72a1035f
commit f40ee148ea

View file

@ -125,6 +125,12 @@ fn keycode_to_keypad(keycode: Keycode) -> Option<keypad::Keys> {
Keycode::Down => Some(keypad::Keys::Down), Keycode::Down => Some(keypad::Keys::Down),
Keycode::Left => Some(keypad::Keys::Left), Keycode::Left => Some(keypad::Keys::Left),
Keycode::Right => Some(keypad::Keys::Right), 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, _ => None,
} }
} }