Skip to content

Add optional macOS touchpad navigation#1236

Open
AndyParka wants to merge 2 commits into
deepnight:masterfrom
AndyParka:agent/macos-touchpad-navigation
Open

Add optional macOS touchpad navigation#1236
AndyParka wants to merge 2 commits into
deepnight:masterfrom
AndyParka:agent/macos-touchpad-navigation

Conversation

@AndyParka

@AndyParka AndyParka commented Jul 22, 2026

Copy link
Copy Markdown

Summary

  • add an opt-in Enable MacOS TouchPad setting under Controls
  • use two-finger movement to pan the editor camera when the setting is enabled
  • tweak pinch-to-zoom function to feel good and behave consistently in main view and sidebar Tiles view.
  • keep the existing mouse-wheel zoom behavior as the default

Motivation

On macOS TouchPads, LDtk currently treats two-finger vertical movement as zoom input, and ignores horizontal movement. This makes navigation different to common canvas tools, where two-finger movement pans the view, and pinch gestures zoom.

The changes

This implementation reuses LDtk's existing camera movement and zoom paths.

  • added a settings menu checkbox for this function - so it's opt-in to keep existing mouse controls unchanged.

  • working in both the main world view, and the sidebar "Tiles" view, and "Project Tilesets" view.

  • when Touchpad mode is enabled, the existing "Mouse wheel speed" setting controls pinch-to-zoom sensitivity in both the main editor and tileset previews.

  • when Touchpad mode is enabled, to keep a consistent feeling in both the world view, and sidebar views - this zoom sensitivity also applies to the sidebar views.

This seemed to be the best way to handle this at the time, removing the need for another zoom sensitivity value. People who are regularly swapping between Mouse and Touchpad may not prefer this decision.

Related to #278, #480, #537, and #959.

Testing

  • launched the compiled Electron development build successfully on macOS and Windows 11 24H2

  • verified on a physical macOS trackpad: two-finger panning and pinch-to-zoom work as expected

  • verified with Apple Magic Mouse, usable as expected.

  • verified with a Logitech G305 on macOS and Windows. Existing pointer and drag controls remain functional; with Touchpad mode enabled, wheel input pans rather than zooms by design.

Implementing this change over top of existing functionality and then removing the toggle checkbox could be an option, however some people who are used to the current trackpad control scheme and people trying windows and linux track-pads may encounter unpredictable results.

  • unable to test on windows or linux trackpad, expect results will vary depending on driver and trackpad function support. Due to this, labeled as "macOS" as this functionality is expected on a macbook.
SCR-20260722-olbe-2

AI disclosure: Developed with assistance from OpenAI Codex. The implementation was reviewed, compiled, and manually tested on physical hardware.

@AndyParka
AndyParka marked this pull request as ready for review July 22, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant