diff --git a/src/App/GamepadModal/GamepadDiagram.tsx b/src/App/GamepadModal/GamepadDiagram.tsx index 10eefb23f..20df63418 100644 --- a/src/App/GamepadModal/GamepadDiagram.tsx +++ b/src/App/GamepadModal/GamepadDiagram.tsx @@ -91,6 +91,19 @@ const GamepadDiagram = () => { const STX = 75; const BY = 30; + // Xbox controllers are asymmetric — left stick sits upper-left (where the + // d-pad is on PlayStation) and the d-pad drops to the lower-left. + const isXbox = (gamepad?.controllerType ?? 'generic') === 'xbox'; + const lstickPos = isXbox + ? { cx: CX - BX, cy: 148 + BY } + : { cx: CX - STX, cy: 240 + BY }; + const dpadPos = isXbox + ? { cx: CX - STX, cy: 240 + BY } + : { cx: CX - BX, cy: 149 + BY }; + const navLine = isXbox + ? { x1: CX - BX - 24, y1: 148 + BY } + : { x1: CX - STX - 24, y1: 232 + BY }; + return ( @@ -190,16 +203,16 @@ const GamepadDiagram = () => { {layout.left.glyph} - - + + - - - - - - + + + + + + @@ -216,7 +229,7 @@ const GamepadDiagram = () => { - +