From cfd2ed887a7ef8b4d6ad3e3141456f100c8ddb86 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 4 Nov 2021 09:25:07 -0400 Subject: [PATCH] Fix numpad navigation for Mac --- src/player.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/player.rs b/src/player.rs index fbd0655..e0c66d0 100644 --- a/src/player.rs +++ b/src/player.rs @@ -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) }