Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#3 | node-gallery-keyboard-shortcuts.patch | 1.59 KB | scroogie |
Comments
Comment #1
dddave CreditAttribution: dddave commentedComment #2
scroogie CreditAttribution: scroogie commentedI 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
Comment #3
scroogie CreditAttribution: scroogie commentedSo 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.
Comment #4
justintime CreditAttribution: justintime commentedSweet. Committed to dev, sorry for the delay, it got buried in my inbox. Thanks @scroogie.
Comment #6
tribsel CreditAttribution: tribsel commentedhi. 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.
Comment #7
tribsel CreditAttribution: tribsel commentedComment #8
scroogie CreditAttribution: scroogie commentedIt'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.
Comment #9
zengenuity CreditAttribution: zengenuity commentedAt this point, I won't be adding new features to the D6 version. If features are wanted for D7, please post a new issue.
Comment #11
hirtenjunge CreditAttribution: hirtenjunge commented@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