Skip to content

feat(controls): let the scroll wheel scroll in-app views without a Mouse Area - #241

Open
BettTer wants to merge 1 commit into
PlayCover:masterfrom
BettTer:feat/scroll-wheel-scroll-views
Open

BettTer wants to merge 1 commit into
PlayCover:masterfrom
BettTer:feat/scroll-wheel-scroll-views

Conversation

@BettTer

@BettTer BettTer commented Oct 12, 2026 •

Copy link
Copy Markdown

Problem

With keymapping and "Enable scroll wheel" turned on, the scroll wheel only does something when the keymap contains a Mouse Area mapping. The handler that turns wheel input into a touch swipe, CameraAction.dragUpdated, is registered only from CameraAction.init(data:). When the keymap has no Mouse Area, which is common for menu-driven games, ScrollWheelDrag is dispatched to nothing, so lists and other scroll views can't be scrolled with a mouse wheel.

Changes

  • ActionDispatcher.build() registers CameraAction.dragUpdated for ScrollWheelDrag when the keymap has no Mouse Area. It swipes from the live cursor position, which is what the wheel already does when a Mouse Area exists.
  • The hard-coded * 4 drag multiplier becomes a scrollWheelSpeed setting. The default is 4, so nothing changes unless the user changes it.
  • scrollWheelSpeed is optional in AppSettingsData. AppSettingsData uses synthesized decoding, so a required new key would make a settings file written by a PlayCover without this key fail to decode, and every setting would fall back to its default.

Not affected

  • Cursor visibility and the option-key toggle: cursorHideNecessary only looks at the LMB and Mouse keys.
  • Clicks and drags: they go through FakeMouse, a separate key.
  • Keymaps with a Mouse Area: CameraAction registers the handler as before.
  • "Enable scroll wheel" turned off: the wheel isn't hooked at all, as before.

Related

PlayCover/PlayCover#2249 adds the speed slider to the app settings.

Testing

Tested on macOS 15.8 (Apple Silicon) with PlayCover built from develop plus this change and PlayCover/PlayCover#2249, using a game whose keymap has no Mouse Area:

  • The scroll wheel scrolls lists and other scroll views under the cursor.
  • The cursor stays visible and clicks work as before.
  • Changing the speed setting changes the scroll distance after the game is restarted.

I also checked decoding separately: a settings plist without scrollWheelSpeed fails to decode when the field is required, and decodes with all other values kept when it is optional.

…e speed

The scroll-wheel drag handler (`CameraAction.dragUpdated`) was only
registered from `CameraAction.init(data:)`, which is constructed solely
when the keymap contains a MouseArea. With an empty keymap the wheel
dispatched `ScrollWheelDrag` to nothing, so it did nothing at all.

`dragUpdated` is static and starts its swipe from the live cursor
position, so it is inherently global - the MouseArea's own coordinates
are only used by camera rotation. Register it in `ActionDispatcher.build()`
when no MouseArea exists, so it is never registered twice.

This does not touch `cursorHideNecessary` (which only inspects the `LMB`
and `Mouse` keys), so the cursor stays visible and the option-key toggle
behaves as before. Clicks and drags are unaffected: they dispatch through
`FakeMouse`, a separate key.

Also replaces the hard-coded x4 drag multiplier with a `scrollWheelSpeed`
setting (default 4, preserving existing behaviour). The setting is
optional in `AppSettingsData`, so a settings file written by a PlayCover
version without this key still decodes instead of falling back to all
default settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TheMoonThatRises TheMoonThatRises added ai-pr Pull request generated with AI (with or without assistance) enhancement New feature or request labels Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-pr Pull request generated with AI (with or without assistance) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants