Stop the mouse pointer from scrolling the map at a screen edge #3

Manually merged
alex19EP merged 1 commit from oasis1701/StellarisAccess:feat/no-edge-scroll into main 2026-11-27 01:33:36 +03:00
Contributor

A proposal to switch off the game's mouse edge scrolling while the mod runs. Blind players never pan with the mouse, and a pointer they can't see, left at a screen edge, drags the map away from where the keyboard puts it.

The problem

On 2026-11-17 the lane dial said "Icons off screen" for every neighbour, even right after Ctrl+Up. The mouse pointer was resting in the top-right corner. The galaxy camera was held at the map's north-east limit (look-at -1000, -1000), following nothing. Moving the pointer to the middle fixed it.

CGameCamera::UpdateScrollingMovement (Steam v4.6.0 0x141060910) treats the pointer as at an edge when it is within the NCamera define EDGE_SCROLLING_PIXELS (3) of a window side. On an edge it scrolls toward that side if Screen Edge Panning is on, then calls AbortObjectFocus whatever the setting says. FocusOn only sets the focus object, and UpdateFollowBehavior moves the camera while one is set. So by the listing, even with the setting off, a pointer on an edge cancels every camera move the map cursor makes. That case wasn't tested in game.

The change

  • src/edge_scroll.cpp sets EDGE_SCROLLING_PIXELS to INT32_MIN from an input-pump tick, so no pointer position counts as an edge. hooks::uninstall puts the game's value back on unload (not yet exercised). One engine global is written, and no hook is installed.
  • A new [[global_slot]] in tools/addrgen/manifest.toml (anchor CGameCamera::UpdateScrollingMovement, load_index 3, expect_symbol NDefines::NCamera::EDGE_SCROLLING_PIXELS).
  • A new gate edge_scroll in tools/siggen/gates.toml.
  • The engine facts are in docs/dev/engine/selection-camera.md ("Edge scrolling"), with a line in the dial plan.

UX decisions made here

  • Edge scrolling is off for the whole session. There is no setting to turn it back on.
  • While the mod runs, the game's own Screen Edge Panning setting does nothing.
  • The gate's spoken label is "the block on mouse edge scrolling". On a game version the mod has no table for, it ends the startup line "New game version. N screens are switched off: ...".

Generated tables to regenerate

This branch doesn't build as committed. addrs_generated, sigs_generated and deps_generated aren't included, because the GOG column needs the GOG v4.6.0 program and we don't have it. Please run:

just regen-addrs
just regen-sigs
just check-locate
just build

If GOG is no longer maintained, a zero GOG address is safe. edge_scroll::install() logs an error and leaves edge scrolling on.

For the first test build, on v4.5.4, we ran the generator Steam-only (--primary-only) against our own Ghidra project, which has v4.5.2 names migrated onto Steam v4.5.4. All 215 existing Steam addresses came out identical to main, and the new entry resolved to 0x14311c900. That matches the listing (read at 0x140f379ff) and a live read of 3 in the running game.

Tested

In game on Steam v4.5.4, with the pointer placed in the top-right corner and then moved along every edge. 37 dial lines came without "Icons off screen". The camera stayed on the cursor's system (a live read showed it following system 306, 24 of 30 system icons drawn), and Screen Edge Panning was still on in the settings. The log shows edge_scroll: EDGE_SCROLLING_PIXELS 3 -> off and no faults.

Rebased onto v4.6.0

Rebased on 2026-11-24 onto the v4.6.0 port (e3e5a90) with no conflicts, and the Steam v4.5.4 addresses in the code comment, the manifest note and the engine doc replaced with Steam v4.6.0 ones. UpdateScrollingMovement has the same 433 instructions and the same constants on v4.6.0, and the define is still its fourth writable-data read, so load_index 3 holds. Our Steam-only regeneration resolves it to 0x143341b18 (read at 0x141060d2f). A v4.6.0 launch of a local build with this change logged edge_scroll: EDGE_SCROLLING_PIXELS 3 -> off and no faults. The pointer test wasn't repeated on v4.6.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EZNZEiCiFiHusWHbDPjYoQ

A proposal to switch off the game's mouse edge scrolling while the mod runs. Blind players never pan with the mouse, and a pointer they can't see, left at a screen edge, drags the map away from where the keyboard puts it. ## The problem On 2026-11-17 the lane dial said "Icons off screen" for every neighbour, even right after Ctrl+Up. The mouse pointer was resting in the top-right corner. The galaxy camera was held at the map's north-east limit (look-at -1000, -1000), following nothing. Moving the pointer to the middle fixed it. `CGameCamera::UpdateScrollingMovement` (Steam v4.6.0 `0x141060910`) treats the pointer as at an edge when it is within the NCamera define `EDGE_SCROLLING_PIXELS` (3) of a window side. On an edge it scrolls toward that side if Screen Edge Panning is on, then calls `AbortObjectFocus` whatever the setting says. `FocusOn` only sets the focus object, and `UpdateFollowBehavior` moves the camera while one is set. So by the listing, even with the setting off, a pointer on an edge cancels every camera move the map cursor makes. That case wasn't tested in game. ## The change - `src/edge_scroll.cpp` sets `EDGE_SCROLLING_PIXELS` to `INT32_MIN` from an input-pump tick, so no pointer position counts as an edge. `hooks::uninstall` puts the game's value back on unload (not yet exercised). One engine global is written, and no hook is installed. - A new `[[global_slot]]` in `tools/addrgen/manifest.toml` (anchor `CGameCamera::UpdateScrollingMovement`, `load_index` 3, `expect_symbol` `NDefines::NCamera::EDGE_SCROLLING_PIXELS`). - A new gate `edge_scroll` in `tools/siggen/gates.toml`. - The engine facts are in `docs/dev/engine/selection-camera.md` ("Edge scrolling"), with a line in the dial plan. ## UX decisions made here - Edge scrolling is off for the whole session. There is no setting to turn it back on. - While the mod runs, the game's own Screen Edge Panning setting does nothing. - The gate's spoken label is "the block on mouse edge scrolling". On a game version the mod has no table for, it ends the startup line "New game version. N screens are switched off: ...". ## Generated tables to regenerate This branch doesn't build as committed. `addrs_generated`, `sigs_generated` and `deps_generated` aren't included, because the GOG column needs the GOG v4.6.0 program and we don't have it. Please run: ``` just regen-addrs just regen-sigs just check-locate just build ``` If GOG is no longer maintained, a zero GOG address is safe. `edge_scroll::install()` logs an error and leaves edge scrolling on. For the first test build, on v4.5.4, we ran the generator Steam-only (`--primary-only`) against our own Ghidra project, which has v4.5.2 names migrated onto Steam v4.5.4. All 215 existing Steam addresses came out identical to `main`, and the new entry resolved to `0x14311c900`. That matches the listing (read at `0x140f379ff`) and a live read of 3 in the running game. ## Tested In game on Steam v4.5.4, with the pointer placed in the top-right corner and then moved along every edge. 37 dial lines came without "Icons off screen". The camera stayed on the cursor's system (a live read showed it following system 306, 24 of 30 system icons drawn), and Screen Edge Panning was still on in the settings. The log shows `edge_scroll: EDGE_SCROLLING_PIXELS 3 -> off` and no faults. ## Rebased onto v4.6.0 Rebased on 2026-11-24 onto the v4.6.0 port (`e3e5a90`) with no conflicts, and the Steam v4.5.4 addresses in the code comment, the manifest note and the engine doc replaced with Steam v4.6.0 ones. `UpdateScrollingMovement` has the same 433 instructions and the same constants on v4.6.0, and the define is still its fourth writable-data read, so `load_index` 3 holds. Our Steam-only regeneration resolves it to `0x143341b18` (read at `0x141060d2f`). A v4.6.0 launch of a local build with this change logged `edge_scroll: EDGE_SCROLLING_PIXELS 3 -> off` and no faults. The pointer test wasn't repeated on v4.6.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EZNZEiCiFiHusWHbDPjYoQ
A mouse pointer resting near a window edge scrolls the game's camera, and
the same check drops whatever the camera is following. A blind player
cannot tell where the pointer is. On 2026-11-17 one left in the top-right
corner held the galaxy camera at the map's north-east limit, the camera
did not follow the map cursor's Ctrl+Up moves, and the lane dial said
"Icons off screen" for every neighbour.

The edge test is in CGameCamera::UpdateScrollingMovement (Steam v4.5.4
0x140f375e0). It compares the pointer's distance from the nearest window
side with the NCamera define EDGE_SCROLLING_PIXELS (3). The game's Screen
Edge Panning setting gates only the scroll. AbortObjectFocus runs on an
edge either way, so by the listing turning the setting off would still
cancel the cursor's camera moves (FocusOn only sets the focus object, and
UpdateFollowBehavior moves the camera while one is set). That case was
not tested in game.

The new edge_scroll module sets that define to INT32_MIN from an
input-pump tick, so no pointer position counts as an edge. On unload
hooks::uninstall puts the game's value back (not yet exercised). It
writes one engine global and installs no hook. While the mod runs, the
game's Screen Edge Panning setting does nothing.

The define's address is a new [[global_slot]] (anchor
CGameCamera::UpdateScrollingMovement, load_index 3, expect_symbol
NDefines::NCamera::EDGE_SCROLLING_PIXELS). The regenerated address,
signature and gate tables are not in this commit, because the GOG column
needs the GOG v4.5.4 program. A missing address makes install() log an
error and leave edge scrolling on. New gate edge_scroll, label "the block
on mouse edge scrolling".

Verified in game on Steam v4.5.4 with a local Steam-only regeneration
(all 215 existing Steam addresses unchanged, the new one 0x14311c900).
With the pointer in the top-right corner and then moved along the
edges, 37 dial lines came without "Icons off screen", and the
camera stayed on the cursor's system with Screen Edge Panning still on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EZNZEi1Ynnv9ZcX5jozmLp
oasis1701 force-pushed feat/no-edge-scroll from acc96bc2d3 to 8dad80c413 2026-11-25 03:59:46 +03:00 Compare
alex19EP manually merged commit 803eb7dde1 into main 2026-11-27 01:33:36 +03:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alex19EP/StellarisAccess!3
No description provided.