Hi,

It will be better if we can have option to assign keyboard shortcut to see next and previous image. So, instead of clicking the "Previous/Next", we can use keyboard arrow key.

I had tried with no luck.

Thanks in advance

CommentFileSizeAuthor
#3 node-gallery-keyboard-shortcuts.patch1.59 KBscroogie
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dddave’s picture

Version: 6.x-2.0-alpha11 » 6.x-3.x-dev
scroogie’s picture

I really like this idea. As a memo to myself, or anyone else who want's to try this out, here is the keypress handler from jquery (http://api.jquery.com/keypress/) and some code from John Resig (jquery author) to bind hotkeys: http://github.com/jeresig/jquery.hotkeys/blob/master/jquery.hotkeys.js

scroogie’s picture

Assigned: Unassigned » scroogie
Status: Active » Needs review
FileSize
1.59 KB

So here it is, in all it's simplicity. 9 lines of code without braces and comments. You gotta love jquery. :)

This is only enabled if the navigator is shown. I think this makes sense, as otherwise people probably don't want to have any way to go to the previous or next item.

justintime’s picture

Status: Needs review » Fixed

Sweet. Committed to dev, sorry for the delay, it got buried in my inbox. Thanks @scroogie.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tribsel’s picture

hi. im not sure if it makes sense to reopen this issue now, but... this keyboard navigation is maybe useful, but it should be possible to turn it off.. In current implementation node gallery displays next image even while typing comment - in text area under the image. pretty annoying... you are typing comment, wnat to change something, press arrow and whooops, you are on next page, great.

tribsel’s picture

Status: Closed (fixed) » Active
scroogie’s picture

It's because the event is bound to the whole document. It could be bound to the image or wrapper element only, but then people have to focus that first before the shortcuts works. Otherwise we could of course exclude any inputs.

zengenuity’s picture

Status: Active » Fixed

At this point, I won't be adding new features to the D6 version. If features are wanted for D7, please post a new issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

hirtenjunge’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
Issue summary: View changes

@scroogie:
Hello, do you know, ist this patch still workin? And can you give me a short discription how to implement such a patch?

Greetings from Hamburg
MArco