Skip to content

Commit

Permalink
Merge pull request #6 from VictorKoenders/sdl3
Browse files Browse the repository at this point in the history
Fixed key input not working
  • Loading branch information
17cupsofcoffee authored Nov 28, 2024
2 parents ecd4284 + b1d5c6e commit 4b6bfb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/input/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ impl Event {
pub fn try_from_sdl_event(event: &SDL_Event) -> Option<Self> {
unsafe {
match SDL_EventType(event.r#type) {
SDL_EVENT_KEY_DOWN if event.key.repeat => {
SDL_EVENT_KEY_DOWN if !event.key.repeat => {
if let Some(key) = Key::from_raw(event.key.scancode) {
return Some(Event::KeyDown(key));
}
}

SDL_EVENT_KEY_UP if event.key.repeat => {
SDL_EVENT_KEY_UP if !event.key.repeat => {
if let Some(key) = Key::from_raw(event.key.scancode) {
return Some(Event::KeyUp(key));
}
Expand Down

0 comments on commit 4b6bfb2

Please sign in to comment.