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:
@@ -614,7 +614,15 @@
|
||||
|
||||
window.CO_App = {
|
||||
joinSelected: joinSelected,
|
||||
getState: function () { return state; }
|
||||
getState: function () { return state; },
|
||||
setPointerMode: function (mode) {
|
||||
if (!root) return;
|
||||
var gamepad = mode === "gamepad";
|
||||
root.classList.toggle("co-gamepad-mode", gamepad);
|
||||
if (window.CO_Hover && CO_Hover.clear) {
|
||||
CO_Hover.clear();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
state.allServers = (window.CO_MOCK_SERVERS || []).slice();
|
||||
|
||||
@@ -80,6 +80,11 @@ body {
|
||||
cursor: var(--co-cursor);
|
||||
}
|
||||
|
||||
.co-root.co-gamepad-mode,
|
||||
.co-root.co-gamepad-mode * {
|
||||
cursor: none !important;
|
||||
}
|
||||
|
||||
.co-root {
|
||||
position: relative;
|
||||
width: 100vw;
|
||||
|
||||
Reference in New Issue
Block a user