Open link from Wix Gallery Pro in new tab if ctrl-key is down

Hi, I need some help with a Corvid-problem I have been stuck with for a while.

I have a Wix Gallery Pro grid containing several images, where each image redirects the website to a new link when clicked. I want the link to be opened in a new tab when being clicked together with the ctrl-key, but when the ctrl-key is up I just want it to open in the same window.

I have tried the following code snippet, but the problem is that the ctrl-key doesn’t seem to get recognized when being pushed down. Also, I don’t know how to redirect to the link in the two different ways.

Does anyone have any tips for me? :slight_smile:

$w.onReady(function () {

    $w("#gallery1").onItemClicked((event) => {
         if (event.ctrlKey) {
            console.log("Ctrl down");
            wixLocation.to(event.item.link); //Redirect the link with a new tab
         } else {
             console.log('Ctrl up');
             wixLocation.to(event.item.link); //Redirect the link in the same tab
         }
    })
});

This does not work, because there is no KEYBOARD-EVENT on this element.

You have KEYBOARD-EVENTS on a TEXTFIELD, RICH_TEXTFIELD and INPUTS.
I think what you are trying to do is not possible with the standard elements and options given by CORVID.

You may take a look yourself …
https://www.wix.com/corvid/reference/$w/gallery.

But perhaps someone knows a workaround, who knows. :grin:

You are probably right, I haven’t found anything that works. I hoped for someone having some kind of smart workaround I couldn’t think of, but it feels lika a long shot. Thank you for you response!

@gabriella_thoren
Perhaps, you will find it one day, when Wix and Corvid features are improved in future.

You can take a look at …
-Corvid-Wishlist
-Corvid-Updates
and also see what is in developement at the moment.

All this you will find here…
https://russian-dima.wixsite.com/meinewebsite/blank-5