Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ int main(int argc, char** argv) {
int b = RemapSdlButton(event.cbutton.button);
if (b >= 0)
HandleGamepadInput(b, event.type == SDL_CONTROLLERBUTTONDOWN);

// Check for start and select buttons pressed and if so exit game
SDL_GameController* controller = SDL_GameControllerFromInstanceID(event.cbutton.which);
if (SDL_GameControllerGetButton(controller, SDL_CONTROLLER_BUTTON_START) && SDL_GameControllerGetButton(controller, SDL_CONTROLLER_BUTTON_BACK)) {
running = false;
}
break;
}
case SDL_MOUSEWHEEL:
Expand Down