User presses a key trouble

Jan 25, 2019

Hey!

I use 'user presses a key' trigger to switch between layers. When a user is holding a left key, e.g., layers are quickly switching between each other which is ruining the mechanic of my training =(. 

So, question: Can I anyhow prevent this?

If my text is not understandable, just reply and I'll try to explain and show.

3 Replies
Ned Whiteley

Hi Lada,

The problem you have is that computer keyboards have a repeat rate that causes the character to be repeated if the user holds the key down. This is the equivalent of rapidly pressing the key several times, which is why your slides keep changing.

The best way to avoid this problem is to use either the built-in player controls (Next / Previous) or your own on-screen Next / Previous buttons which you have to select with the mouse. In either of these cases, the slide change will only occur when the mouse button is released, thus avoiding multiple slide changes if the user hold the mouse button down.

Ned Whiteley

Hi Lada,

Although not perfect, the attached example may help.

What I have done is to set Page Up and Page Down keys to replace the Next and Previous buttons. I have also set up a variable called SlideDelayComplete that is initially set to False and only changes to True 5 seconds after the timeline starts on each slide. In order for the Page Down key to advance the slide, not only does the key need to be pressed, but the slide also has to have been visible for at least 5 seconds.

Although this won't prevent slides advancing every 5 seconds if the user keeps the Page Down key pressed, hopefully they will realise their mistake after the first slide change and so they will only have to go back one slide rather than have five or six slides flash up in quick succession. If you know that you want your users to view a particular slide for at least 15 seconds, for example, you could always adjust that slide's delay to suit.

Hope this helps

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