forked from StrafesNET/strafe-client
Compare commits
No commits in common. "master" and "master" have entirely different histories.
@ -100,19 +100,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"|"W"=>Some(InputInstruction::MoveForward(s)),
|
"w"=>Some(InputInstruction::MoveForward(s)),
|
||||||
"a"|"A"=>Some(InputInstruction::MoveLeft(s)),
|
"a"=>Some(InputInstruction::MoveLeft(s)),
|
||||||
"s"|"S"=>Some(InputInstruction::MoveBack(s)),
|
"s"=>Some(InputInstruction::MoveBack(s)),
|
||||||
"d"|"D"=>Some(InputInstruction::MoveRight(s)),
|
"d"=>Some(InputInstruction::MoveRight(s)),
|
||||||
"e"|"E"=>Some(InputInstruction::MoveUp(s)),
|
"e"=>Some(InputInstruction::MoveUp(s)),
|
||||||
"q"|"Q"=>Some(InputInstruction::MoveDown(s)),
|
"q"=>Some(InputInstruction::MoveDown(s)),
|
||||||
"z"|"Z"=>Some(InputInstruction::Zoom(s)),
|
"z"=>Some(InputInstruction::Zoom(s)),
|
||||||
"r"|"R"=>if s{
|
"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"|"F"=>if s{Some(InputInstruction::PracticeFly)}else{None},
|
"f"=>if s{Some(InputInstruction::PracticeFly)}else{None},
|
||||||
_=>None,
|
_=>None,
|
||||||
},
|
},
|
||||||
_=>None,
|
_=>None,
|
||||||
|
Loading…
Reference in New Issue
Block a user