Ctrl+Click Trigger

Feb 07, 2013

Can a Ctrl+mouse click trigger be created in Storyline? We are working on a software simulation where the learner must be able to select multiple items from a dialog box using this combination.

12 Replies
Christine Hendrickson

Welcome to E-Learning Heroes, Ruby!

I don't believe it's currently possible to do this. You can assign another key with the CTRL key, but an "on click" trigger would be separate. For example, you could use a trigger for CTRL+Enter, or a trigger for a click, but not both. I do think this combination would make a great feature request, though

Marko Stojkovski

Hello. This is an old topic, but I found it is unsolved, and I was looking for a solution until few hours ago, so that's how I found it.
I have solved this problem with a little bit of JavaScript, and my project is working perfectly.

I have written a small LinkedIn article about how to solve the problem, so you can preview it. I have also shared the javascript code and the .story file, so feel free to take a look at the details, and I hope you may find it helpful.

Link to the article: https://www.linkedin.com/pulse/ctrl-click-select-many-shift-trigger-software-marko-stojkovski?published=t

I have also created a post on my webpage, with the same content, so here is another link to the same solution: http://www.enaspot.com/?portfolio=ctrl-click-trigger-select-many-in-software-simulation

Stefan K

Hi Math,

Thank you, I am impressed, that looks great.

What I am trying to do is slightly different, so I think that won'T work for me: I need to change a Storyline Variable to value=true when the CTRL key is pressed and keep it at value=true as long as it is pressed and change it back to value=false as soon as the key is not pressed any longer.

Unfortunately I am no JS coder, I tried working with this, but it does not work:


eventTarget.addEventListener("keydown", (event) => {
if (event.isComposing || event.keyCode === 17) {
return;
}
var player = GetPlayer();
player.SetVar("isCTRLClicked",true);
});


eventTarget.addEventListener("keyup", (event) => {
if (event.isComposing || event.keyCode === 17) {
return;
}
var player = GetPlayer();
player.SetVar("isCTRLClicked",false);
});