TrackpadGestures — a plugin for JOSM that adds touchpad support

Hello! I’m looking for testers and feedback for TrackpadGestures from anyone who uses a laptop and spends a lot of time editing with JOSM. This plugin adds support for the basic pan and pinch-to-zoom gestures, making it much more practical to use JOSM without a mouse. It can be installed directly through JOSM settings in the Plugins section.

TrackpadGestures icon

In addition to two-finger panning and pinch-to-zoom, the plugin also supports rotate and zoom gestures for selected objects. These can be activated by holding Shift+Ctrl or Alt+Ctrl, respectively. There’s also a quick two-finger double-tap gesture that alternates between zooming in and zooming back out.

The plugin has been developed and tested on Fedora 44, Windows 11, and macOS 27. While it should work on other OS versions, they have not been tested yet.

On macOS, an additional three-finger tap gesture is available. It emulates a middle mouse button click, making it easy to cycle through nearby or overlapping objects. Furthermore, on Apple Force Touch trackpads, pressing firmly on a line or polygon will “pick up” the object and attach it to the cursor, allowing you to move it effortlessly. The next click drops the object at its new location.

Because of JOSM’s architecture, the editor cannot provide perfectly smooth rendering, especially when a data layer contains a large number of objects. Nevertheless, I decided to implement inertial scrolling after a two-finger flick. To improve frame rates while panning, I recommend avoiding excessively large data layers and using Wireframe mode whenever possible.

The plugin is still experimental and fairly rough around the edges. Crashes and unexpected behavior are possible. Please avoid using it for long mapping sessions without saving your work frequently. I’d really appreciate any feedback in this thread, whether it’s bug reports or ideas for improving the plugin :heart:

4 Likes

Amazing, thank you! I’ve just tried it, pinch zoom works wonderfully on MacOS 27 beta. I would love to have a single-left-mousebutton-pan, as I am struggling a lot with the two-finger pan gesture (as included in JOSM by default). It has a tendency of accidentally zooming or jumping around. In fact this is the only reason I keep using ID for simpler edits.

1 Like

I have run into a bug: when using the plugin along with the Align Imagery function, sometimes not only the imagery but also the geometry of other objects is moved.

Thanks for the feedback and for the bug report! I’m not sure I fully understood the issue and couldn’t reproduce it on my end. Did you mean the “New Offset” option shown in the screenshot?

If possible, could you briefly describe the steps that lead to the issue? That would help me reproduce it and try to fix it.

Yes, it is this function. Here is a screencast demonstrating the New Offset operation first without, then with the plugin under MacOS 27 beta 7 and JOSM 19613: https://youtu.be/_l4nwzE_vUw. So essentially this function lets me drag the imagery under the vector data to align it. Without the plugin, the imagery moves correctly under the currently displayed vector data. With the plugin, when left-click-dragging the imagery, the vector data also sometimes randomly gets moved (or scrolled?) around.

1 Like

Fixed in 0.4.2. The plugin now ignores trackpad gestures while you drag with the left mouse button held.

JOSM should pick the new version up on its own the next time it starts; if it doesn’t, you can update it by hand from Preferences → Plugins.

Thanks for the report and for taking the time to record the screencast!

1 Like