RedditDownloader icon indicating copy to clipboard operation
RedditDownloader copied to clipboard

Switch between items using Keyboard

Open jobolo23 opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I would love to go through items with my arrow buttons so i dont have to close out of every image/video before opening the next

Describe the solution you'd like:

When an image or a video is open i would like to either use my keyboard or an arrow button to switch the the next or previous item respectively

Additional context:

No more context

jobolo23 avatar Mar 05 '22 20:03 jobolo23

Looks like the arrow key events are captured here: https://github.com/shadowmoose/RedditDownloader/blob/3e4b4ef52be56e50bf3561081fe3257575de0fed/redditdownloader/web/js/Browser.js#L205

Right now, they only have an effect when viewing an album, and doesn't switch between posts. That code is here: https://github.com/shadowmoose/RedditDownloader/blob/3e4b4ef52be56e50bf3561081fe3257575de0fed/redditdownloader/web/js/Browser.js#L258

I think a keypress event capture would need to take place in the browser class further up in the file, where it can control going to the next and previous posts. If the current post is an album not the first/last image, the key presses should be passed down the mediacontainer class like normal. If it's the first album image and left was pressed, go to the previous post, and same for last album image/right arrow to the next post.

Lightbox code will probably need to be moved to the browser class instead of part of each MediaComponent to make it easier to switch between images.

It also might be nice to add A and D for navigation as well.

B13rg avatar Apr 10 '22 05:04 B13rg