Skip to content
Discussion options

You must be logged in to vote

You're trying to access the key variable from SDL_Event.type instead of SDL_Event.

def react(self, event: sdl3.SDL_Event) -> sdl3.SDL_AppResult:
    match event.type:
        case sdl3.SDL_EVENT_KEY_DOWN:
            if event.key.scancode in [sdl3.SDL_SCANCODE_Q]:
                return sdl3.SDL_APP_SUCCESS

    return sdl3.SDL_APP_CONTINUE

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ausreich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants