[Gwenview] Allow arrow keys to work when zoomed in

Pressing arrow keys to go to next/previous images in Gwenview doesn’t work when you have zoomed into the image, only at the default zoom level. It should work regardless of zoom level, in my view.

1 Like

It’ll work if the thumbnail view has keyboard focus, FWIW.

See Add global scope left/right arrow key shortcuts for the view (!137) · Merge requests · Graphics / Gwenview · GitLab for the current state of the discussion on this feature. I’ll copy my comment from there to here:

Would be nice to have this somewhat confusing arrow key behaviour improved. If I am seeing this right, the relevant code is in AbstractImageView::keyPressEvent().

There is an if (zoomToFit) in there that decides whether pressing Right should jump to the next image or instead move the view area to show a different part of the zoomed picture.

Unfortunately I don’t really know what the wanted behaviour is supposed to be. Do you have something in mind?

The functionality there for using the arrow keys to move the viewed frame within a zoomed in picture seems somewhat useful to me in some cases. Do we drop it without replacement? Do we change the picture moving to a modifier (e.g. Ctrl+Right)? Do we do something fancy like changing picture on short press but moving the picture in the view on long press? Or do we actually like the behaviour of having the arrow keys moving the viewed area of the picture around and the real issue is that it also triggers for small pictures that don’t actually Fit the view which in practice means for them that pressing the arrow keys does nothing? :thinking:

When viewing a video we use the right and left arrow keys to seek forward/backward. That would be inconsistent with moving to the next file when the arrow key is pressed. Maybe we could get away with only jumping to the next file in video files, if one arrived at the end of a video? Or maybe we also change the buttons for seeking to some modifier like Ctrl?

I don’t know! I agree that we should probably always move to the previous/next image when using the arrow keys no matter the zoom value but I am already not sure if that is also the expected behaviour for videos. :confused:

1 Like

Set the arrows as shortcuts for “Previous” and “Next” actions in the keyboard shortcuts settings of Gwenview and they will work with zoomed images.

Maybe you can use “page up” and “page down” to navigate to next/previous image when current image is zoomed in?

Works, thanks.

Doesn’t work unless I map shortcuts to those keys, but I can map arrow keys instead.