Forum Discussion

RubyMcCollough's avatar
RubyMcCollough
Community Member
13 years ago

Ctrl+Click Trigger

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

  • 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

  • Could you assign a variable that changes when the user presses the CTRL button then add a condition to the mouse click saying "don't do this unless that variable is true" ? and then perhaps reset the variable to its initial state? Haven't tried it but mabye it would work.

  • Thanks for the feedback. This would definitely be a great built in feature. Randall your variable suggestion has got us thinking and it's worth a try.

  • ReginaOwens's avatar
    ReginaOwens
    Community Member

    Hi Ruby,

    Did you ever get this figured out? I am developing a software simulation with the same requirement for multiple object selection  (Ctrl+mouse click). Any advice would be helpful.

  • 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

  • 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);
    });

     

  • Basic difference is in CTRL+clicking or just a check on a KeyEvent. Im no coder either...Google is your best friend and with a little search you can find anything.

    Here is your fix.