Fix pikachu
This commit is contained in:
parent
950b375609
commit
7e6c67edc9
2 changed files with 7 additions and 5 deletions
|
@ -5,7 +5,7 @@ use super::render::{
|
|||
};
|
||||
use wgpu::util::DeviceExt;
|
||||
use winit::{
|
||||
event::{KeyboardInput, VirtualKeyCode, WindowEvent},
|
||||
event::{KeyboardInput, VirtualKeyCode, WindowEvent, ElementState},
|
||||
window::Window,
|
||||
};
|
||||
|
||||
|
@ -297,14 +297,16 @@ impl State {
|
|||
WindowEvent::KeyboardInput {
|
||||
input:
|
||||
KeyboardInput {
|
||||
state,
|
||||
virtual_keycode: Some(keycode),
|
||||
..
|
||||
},
|
||||
..
|
||||
} => {
|
||||
let is_pressed = *state == ElementState::Pressed;
|
||||
match keycode {
|
||||
VirtualKeyCode::Space => {
|
||||
self.mesh.toggle();
|
||||
self.mesh.toggle(is_pressed);
|
||||
true
|
||||
}
|
||||
_ => self.camera_controller.process_events(event),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue