Javascript: While holding down key

Apr 03, 2014

I have a question for the more experienced javascripters out there.  I have a activity in mind that I want to try in storyline.  I want the state of an object to change while they are holding down a keyboard key. I know Storyline cannot support this, but I was thinking of executing a javascript at the beginning of a slide. It would change a variable in storyline (true) when the key is being held down, and change it back to false when they let go.  Would this be possible? Or should I just have the user toggle the true by pressing the key and again to change it to false.

The main idea of the activity is the user has to keep something "on" for a certain amount of time. There will be a timer on the slide for a countdown. Holding down the key would better mimic the action, but if they have to just press the key a couple of times, I guess I'll just go down that route.

Be the first to reply

This discussion is closed. You can start a new discussion or contact Articulate Support.