From 3c0fef83a1859f9d2932380126d7f6831d2c7499 Mon Sep 17 00:00:00 2001 From: blearymoth <237650870+blearymoth@users.noreply.github.com> Date: Tue, 8 Sep 2026 20:28:08 -0700 Subject: [PATCH] feat: add Steam Deck / gamepad camera controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Optional DISPLAY → Gamepad mapping for sticks, triggers, and face buttons, with altitude-scaled look sensitivity and a persisted on/off preference. Co-authored-by: Cursor --- .env.example | 4 + CHANGELOG.md | 7 + docs/CURRENT-STATE.md | 2 +- index.html | 13 + src/deckControls.js | 485 ++++++++++++++++++++++++++++++++++++++ src/deckControls.test.mjs | 52 ++++ src/main.js | 2 + style.css | 137 +++++++++++ vite.config.js | 2 + 9 files changed, 703 insertions(+), 1 deletion(-) create mode 100644 src/deckControls.js create mode 100644 src/deckControls.test.mjs diff --git a/.env.example b/.env.example index 2a54795..0c87f6c 100644 --- a/.env.example +++ b/.env.example @@ -129,6 +129,10 @@ AISSTREAM_API_KEY= # tiles instead of hitting upstream. # TOMTOM_DAILY_TILE_BUDGET=40000 +# Optional: Steam Deck / gamepad controls default ON. Set to 0 to default off; +# DISPLAY → Gamepad still overrides via localStorage. +# GEV_DECK_CONTROLS=1 + # Optional: CCTV layer tuning (advanced). Defaults are sensible — leave unset # unless you're customizing the camera source pack. # CCTV_SOURCES_FILE=config/cctv_sources.austin.json # path to a source-pack JSON diff --git a/CHANGELOG.md b/CHANGELOG.md index 21544fa..5a499ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ of current runtime behavior, see [`docs/CURRENT-STATE.md`](docs/CURRENT-STATE.md ## [Unreleased] +### Added + +- Steam Deck / gamepad camera controls (`src/deckControls.js`): sticks for + move/look, triggers for zoom, face buttons and D-pad for common UI actions, + optional DISPLAY → Gamepad slider. Defaults on unless `GEV_DECK_CONTROLS=0`; + the slider preference is stored in `localStorage`. + ### Fixed - Mapped-site outages show their scheduled retry countdown and distinguish diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 1f4d861..c7d96ca 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -2318,7 +2318,7 @@ silently demoting every later lookup for the session. - A dock popover (Visual Presets, Location) auto-dismisses on mouse-away unless pinned. Focus inside the tray defers that dismissal only when the browser reports `:focus-visible` — keyboard focus and typed-into fields hold the tray open; a mouse-clicked tile does not, because Chromium focuses a ` +
+ +
+ On + +
+