Fix numpad navigation for Mac
This commit is contained in:
parent
c6abd497a1
commit
cfd2ed887a
@ -63,35 +63,35 @@ pub fn player_input(gs: &mut State, ctx: &mut Rltk) -> RunState {
|
||||
VirtualKeyCode::Left
|
||||
| VirtualKeyCode::Numpad4
|
||||
| VirtualKeyCode::H
|
||||
| VirtualKeyCode::A => try_move_player(-1, 0, &mut gs.ecs),
|
||||
| VirtualKeyCode::Key4 => try_move_player(-1, 0, &mut gs.ecs),
|
||||
|
||||
VirtualKeyCode::Right
|
||||
| VirtualKeyCode::Numpad6
|
||||
| VirtualKeyCode::L
|
||||
| VirtualKeyCode::D => try_move_player(1, 0, &mut gs.ecs),
|
||||
| VirtualKeyCode::Key6 => try_move_player(1, 0, &mut gs.ecs),
|
||||
|
||||
VirtualKeyCode::Up
|
||||
| VirtualKeyCode::Numpad8
|
||||
| VirtualKeyCode::K
|
||||
| VirtualKeyCode::W => try_move_player(0, -1, &mut gs.ecs),
|
||||
| VirtualKeyCode::Key8 => try_move_player(0, -1, &mut gs.ecs),
|
||||
|
||||
VirtualKeyCode::Down
|
||||
| VirtualKeyCode::Numpad2
|
||||
| VirtualKeyCode::J
|
||||
| VirtualKeyCode::S
|
||||
| VirtualKeyCode::X => try_move_player(0, 1, &mut gs.ecs),
|
||||
| VirtualKeyCode::Key2 => try_move_player(0, 1, &mut gs.ecs),
|
||||
|
||||
// Diagonals
|
||||
VirtualKeyCode::Numpad9 | VirtualKeyCode::Y | VirtualKeyCode::E => {
|
||||
VirtualKeyCode::Numpad9 | VirtualKeyCode::Y | VirtualKeyCode::Key9 => {
|
||||
try_move_player(1, -1, &mut gs.ecs)
|
||||
}
|
||||
VirtualKeyCode::Numpad7 | VirtualKeyCode::U | VirtualKeyCode::Q => {
|
||||
VirtualKeyCode::Numpad7 | VirtualKeyCode::U | VirtualKeyCode::Key7 => {
|
||||
try_move_player(-1, -1, &mut gs.ecs)
|
||||
}
|
||||
VirtualKeyCode::Numpad3 | VirtualKeyCode::N | VirtualKeyCode::C => {
|
||||
VirtualKeyCode::Numpad3 | VirtualKeyCode::N | VirtualKeyCode::Key3 => {
|
||||
try_move_player(1, 1, &mut gs.ecs)
|
||||
}
|
||||
VirtualKeyCode::Numpad1 | VirtualKeyCode::B | VirtualKeyCode::Z => {
|
||||
VirtualKeyCode::Numpad1 | VirtualKeyCode::B | VirtualKeyCode::Key1 => {
|
||||
try_move_player(-1, 1, &mut gs.ecs)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user