Skip to content
Merged
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
14 changes: 13 additions & 1 deletion runtime/src/settings_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,18 @@ void DrawTopBar() {
ImGui::EndMainMenuBar();
}

// Steam's desktop layout maps B to Escape on Valve controllers.
bool ValveControllerConnected() {
int count = 0;
SDL_JoystickID* ids = SDL_GetJoysticks(&count);
bool found = false;
for (int i = 0; ids != nullptr && i < count && !found; ++i) {
found = SDL_GetJoystickVendorForID(ids[i]) == 0x28DE && SDL_GetJoystickProductForID(ids[i]) != 0x11FF;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
}
SDL_free(ids);
return found;
}

bool IsToggleKey(const SDL_Event& event, SDL_Scancode code) {
return event.type == SDL_EVENT_KEY_DOWN && !event.key.repeat && event.key.scancode == code;
}
Expand Down Expand Up @@ -1603,7 +1615,7 @@ void HandleEvents(const AuroraEvent* events) noexcept {
g_exitPromptOpen = false;
} else if (g_topBarVisible) {
SetTopBarVisible(false);
} else {
} else if (!ValveControllerConnected()) {
g_exitPromptOpen = true;
}
ApplyInputBlockState();
Expand Down
Loading