Repository navigation
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fromCameraAction.init(data:). When the keymap has no Mouse Area, which is common for menu-driven games,ScrollWheelDragis dispatched to nothing, so lists and other scroll views can't be scrolled with a mouse wheel.Changes
ActionDispatcher.build()registersCameraAction.dragUpdatedforScrollWheelDragwhen 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.* 4drag multiplier becomes ascrollWheelSpeedsetting. The default is 4, so nothing changes unless the user changes it.scrollWheelSpeedis optional inAppSettingsData.AppSettingsDatauses 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
cursorHideNecessaryonly looks at theLMBandMousekeys.FakeMouse, a separate key.CameraActionregisters the handler 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
developplus this change and PlayCover/PlayCover#2249, using a game whose keymap has no Mouse Area:I also checked decoding separately: a settings plist without
scrollWheelSpeedfails to decode when the field is required, and decodes with all other values kept when it is optional.