window: bind case insensitive (closes #7)
This commit is contained in:
parent
0a515f423d
commit
2bd6868882
@ -93,19 +93,19 @@ impl WindowContext<'_>{
|
|||||||
if let Some(input_instruction)=match keycode{
|
if let Some(input_instruction)=match keycode{
|
||||||
winit::keyboard::Key::Named(winit::keyboard::NamedKey::Space)=>Some(InputInstruction::Jump(s)),
|
winit::keyboard::Key::Named(winit::keyboard::NamedKey::Space)=>Some(InputInstruction::Jump(s)),
|
||||||
winit::keyboard::Key::Character(key)=>match key.as_str(){
|
winit::keyboard::Key::Character(key)=>match key.as_str(){
|
||||||
"w"=>Some(InputInstruction::MoveForward(s)),
|
"W"|"w"=>Some(InputInstruction::MoveForward(s)),
|
||||||
"a"=>Some(InputInstruction::MoveLeft(s)),
|
"A"|"a"=>Some(InputInstruction::MoveLeft(s)),
|
||||||
"s"=>Some(InputInstruction::MoveBack(s)),
|
"S"|"s"=>Some(InputInstruction::MoveBack(s)),
|
||||||
"d"=>Some(InputInstruction::MoveRight(s)),
|
"D"|"d"=>Some(InputInstruction::MoveRight(s)),
|
||||||
"e"=>Some(InputInstruction::MoveUp(s)),
|
"E"|"e"=>Some(InputInstruction::MoveUp(s)),
|
||||||
"q"=>Some(InputInstruction::MoveDown(s)),
|
"Q"|"q"=>Some(InputInstruction::MoveDown(s)),
|
||||||
"z"=>Some(InputInstruction::Zoom(s)),
|
"Z"|"z"=>Some(InputInstruction::Zoom(s)),
|
||||||
"r"=>if s{
|
"R"|"r"=>if s{
|
||||||
//mouse needs to be reset since the position is absolute
|
//mouse needs to be reset since the position is absolute
|
||||||
self.mouse=strafesnet_common::mouse::MouseState::default();
|
self.mouse=strafesnet_common::mouse::MouseState::default();
|
||||||
Some(InputInstruction::ResetAndRestart)
|
Some(InputInstruction::ResetAndRestart)
|
||||||
}else{None},
|
}else{None},
|
||||||
"f"=>if s{Some(InputInstruction::PracticeFly)}else{None},
|
"F"|"f"=>if s{Some(InputInstruction::PracticeFly)}else{None},
|
||||||
_=>None,
|
_=>None,
|
||||||
},
|
},
|
||||||
_=>None,
|
_=>None,
|
||||||
|
Loading…
Reference in New Issue
Block a user