Skip to content

Reduce navigation speed using arrow keys in viewer#2038

Merged
petebankhead merged 1 commit intoqupath:mainfrom
petebankhead:navigation
Nov 12, 2025
Merged

Reduce navigation speed using arrow keys in viewer#2038
petebankhead merged 1 commit intoqupath:mainfrom
petebankhead:navigation

Conversation

@petebankhead
Copy link
Member

@petebankhead petebankhead commented Nov 12, 2025

This makes panning easier using the arrow keys by decreasing the effect of a single keypress - which previously could pan too far.

I found the old behavior deeply annoying when trying to pan to a precise location, but it turns out it can already be adjusted with a couple of preferences. So this PR just changes one of them.

Pressing and holding an arrow still makes it possible to gradually accelerate when wanting to move further (at least on macOS) - although there's a preference for this too..

You don't need to build this PR to check it - in QuPath v0.6.0, just reduce the preference value from 100 to 10:

Screenshot 2025-11-12 at 11 12 34

The navigation code is horribly complicated and should probably be revisited, but to me this change is the simplest way to get more intuitive default behavior.

This makes panning easier using the arrow keys by decreasing the effect of a single keypress - which previously could pan too far.

Pressing and holding an arrow still makes it possible to gradually accelerate when wanting to move further (at least on macOS).
Copy link
Contributor

@alanocallaghan alanocallaghan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better, but on Linux at least the behaviour when holding is to go medium speed -> slow speed -> faster, and it's hard to stop things before the viewer shoots off into space.

Aside from my fixing this (presumably platform-specific) weirdness in a future release, we could expose an acceleration rate parameter in future also.

@petebankhead
Copy link
Member Author

How odd... there is a 'Use navigation acceleration' checkbox, but not a way to adjust the speed.

Bizarrely, I'm finding no movement if I set the 'Navigation speed %' below 10%... although it slowly starts to shift if I hold the key down long enough.

Certainly not ideal, but I'll merge this in the interim until anyone wants to delve into it (or we write an entirely new viewer).

Thanks!

@petebankhead petebankhead merged commit 51101d8 into qupath:main Nov 12, 2025
3 checks passed
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.

4 participants