prevent key repeat clogging just_pressed
This commit is contained in:
parent
45ae4223ab
commit
9a978c3b3d
@ -371,6 +371,7 @@ pub fn start_game() -> Result<(), String> {
|
|||||||
}
|
}
|
||||||
Event::KeyDown {
|
Event::KeyDown {
|
||||||
keycode: Some(keycode),
|
keycode: Some(keycode),
|
||||||
|
repeat: false,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
let Some(key) = Key::from_sdl_keycode(keycode) else {
|
let Some(key) = Key::from_sdl_keycode(keycode) else {
|
||||||
@ -409,6 +410,7 @@ pub fn start_game() -> Result<(), String> {
|
|||||||
}
|
}
|
||||||
Event::KeyUp {
|
Event::KeyUp {
|
||||||
keycode: Some(keycode),
|
keycode: Some(keycode),
|
||||||
|
repeat: false,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
let Some(key) = Key::from_sdl_keycode(keycode) else {
|
let Some(key) = Key::from_sdl_keycode(keycode) else {
|
||||||
|
Loading…
Reference in New Issue
Block a user