From fcacf7026f4d310ea5f4f4883f31592ec1a7e763 Mon Sep 17 00:00:00 2001 From: 9382 Date: Mon, 14 Oct 2024 20:18:51 +0100 Subject: [PATCH] Fix movement inputs when holding shift --- src/window.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/window.rs b/src/window.rs index 4320c67..79950eb 100644 --- a/src/window.rs +++ b/src/window.rs @@ -100,19 +100,19 @@ impl WindowContext<'_>{ if let Some(input_instruction)=match keycode{ winit::keyboard::Key::Named(winit::keyboard::NamedKey::Space)=>Some(InputInstruction::Jump(s)), winit::keyboard::Key::Character(key)=>match key.as_str(){ - "w"=>Some(InputInstruction::MoveForward(s)), - "a"=>Some(InputInstruction::MoveLeft(s)), - "s"=>Some(InputInstruction::MoveBack(s)), - "d"=>Some(InputInstruction::MoveRight(s)), - "e"=>Some(InputInstruction::MoveUp(s)), - "q"=>Some(InputInstruction::MoveDown(s)), - "z"=>Some(InputInstruction::Zoom(s)), - "r"=>if s{ + "w"|"W"=>Some(InputInstruction::MoveForward(s)), + "a"|"A"=>Some(InputInstruction::MoveLeft(s)), + "s"|"S"=>Some(InputInstruction::MoveBack(s)), + "d"|"D"=>Some(InputInstruction::MoveRight(s)), + "e"|"E"=>Some(InputInstruction::MoveUp(s)), + "q"|"Q"=>Some(InputInstruction::MoveDown(s)), + "z"|"Z"=>Some(InputInstruction::Zoom(s)), + "r"|"R"=>if s{ //mouse needs to be reset since the position is absolute self.mouse=strafesnet_common::mouse::MouseState::default(); Some(InputInstruction::ResetAndRestart) }else{None}, - "f"=>if s{Some(InputInstruction::PracticeFly)}else{None}, + "f"|"F"=>if s{Some(InputInstruction::PracticeFly)}else{None}, _=>None, }, _=>None,