Keyboard plugin not working

I am using the keyboard plugin here I installed and activated and I tried testing but it doesn't work. I can't use the left & right keyboard to navigate images.

Is there another plugin that can navigate images using the keyboard?


  • acrylian Administrator, Developer
    No, all known are listed there. I don't know that one but it might require adjustments depending on the theme.

    You can try this jQuery javascript code on a normal theme's image.php:
    $(function() {
    $(document).keyup(function (event) {
    if (event.keyCode == 37) {
    // Links
    <?php if (hasPrevImage()) { ?>
    window.location.href="<?php echo getPrevImageURL(); ?>";
    <?php } ?>
    } else if (event.keyCode == 39) {
    // Rechts
    <?php if (hasNextImage()) { ?>
    window.location.href="<?php echo getNextImageURL(); ?>";
    <?php } ?>
  • Oups !

    Can you download it again and report here please. I made a few change.
  • Thanks the plugin is now working :)
  • The keyboard-plugin worked fine for me right away ... for images (i.e. in the image.php page). But I was surprised it didn't also handle left/right arrows in the album.php page (to navigate between albums). I got that working by making a minor change to the plugin:

    if ($_zp_gallery_page = 'album.php') {
    <?php if (getNextAlbum()) { ?>var nextURL="<?=getNextAlbumURL();?>";<?php } ?>
    <?php if (getPrevAlbum()) { ?>var prevURL="<?=getPrevAlbumURL();?>";<?php } ?>
    if ($_zp_gallery_page = 'image.php') {
    <?php if (hasNextImage()) { ?>var nextURL="<?=getNextImageURL();?>";<?php } ?>
    <?php if (hasPrevImage()) { ?>var prevURL="<?=getPrevImageURL();?>";<?php } ?>
  • Yes, you're right.
    i can include your change in the file if you are ok.
  • Sure, feel free to include it.
  • Thank you,

    Your change as been include in the file.
Sign In or Register to comment.