Gamepad-aware cursor handling in server browser

Add gamepad-aware pointer handling so the server browser hides the mouse cursor when a controller is connected and only shows it after mouse movement/click. Changes include:

- PrismaUI: track browser pointer mode, prefer gamepad detection, suppress native CursorMenu/MenuCursor when in gamepad mode, unfocus the Ultralight view to prevent PrismaUI drawing its cursor, and restore pointer mode on mouse activity. Integrate pointer-mode initialization on browser show and call PollGamepad + UpdateBrowserPointerMode in the permanent task loop.
- MenuInput: expose IsGamepadConnected(), provide PollGamepad() wrapper and simplify Register() logging.
- UI: add window.CO_App.setPointerMode to toggle a co-gamepad-mode class and clear hover state; add CSS to hide the HTML cursor when co-gamepad-mode is active.
- docs: add dev-log entries describing the PrismaUI Ultralight cursor fix and the new gamepad-aware server browser behavior.

These changes ensure consistent cursor behavior between mouse and controller input, prevent the Ultralight cursor from appearing in controller mode, and restore the cursor after mouse interaction.
This commit is contained in:
2026-06-18 14:37:31 +12:00
parent f720d35d2a
commit 1353e5a52c
6 changed files with 201 additions and 12 deletions
+52
View File
@@ -7,6 +7,58 @@ failed experiments, successful tests, and next steps.
---
## 2026-06-18 - Fix PrismaUI Ultralight cursor in gamepad mode
### Summary
The custom PrismaUI cursor (`cursor.png`) still appeared when navigating with a controller. The third `Focus()` argument is `disableFocusMenu`, not cursor visibility; PrismaUI draws its cursor only while input capture is active after `Focus()`.
### Files Changed
- `plugin/src/F4TPrismaUI.cpp`
### Details
- Gamepad mode now calls `Unfocus()` so PrismaUI disables input capture and skips `DrawCursor()`.
- Mouse mode calls `Focus(view, false, true)` (`disableFocusMenu=true`) so PrismaUI handles the pip-boy cursor without opening `FocusMenu`.
- Suppress native `CursorMenu` / `MenuCursor` each frame in gamepad mode because PrismaUI re-enables them when capture is off.
### Testing
- Plugin rebuild required; in-game test: controller open → no Ultralight cursor; mouse move → cursor returns.
### Known Issues
- Keyboard navigation in the browser may not reach Ultralight while unfocused in gamepad mode; controller navigation via XInput polling is unaffected.
### Next Steps
- Verify in-game with controller and mouse.
---
## 2026-06-18 - Gamepad-aware cursor in server browser
### Summary
Hide the mouse cursor when a controller is connected and the server browser is open, matching Fallout 4 main-menu behavior. The cursor appears only after mouse movement or a mouse click.
### Files Changed
- `plugin/src/F4TPrismaUI.cpp`
- `plugin/src/F4TMenuInput.cpp`
- `plugin/include/F4TMenuInput.h`
- `ui/views/CommonwealthOnline/browser/app.js`
- `ui/views/CommonwealthOnline/browser/styles.css`
### Details
- On browser open with a gamepad connected: unregister `MenuCursor`, hide `CursorMenu`, and unfocus the PrismaUI view (see follow-up entry above for Ultralight cursor fix).
- Detect mouse movement/clicks each frame and restore the cursor + hover highlights.
- CSS `co-gamepad-mode` hides any HTML cursor styling while in controller mode.
### Testing
- Plugin rebuild succeeded; in-game test with controller + mouse required.
### Known Issues
- None currently known.
### Next Steps
- Verify cursor stays hidden on open with controller and appears after moving the mouse.
---
## 2026-06-18 - XInput polling for server browser gamepad
### Summary