Key press to activate Next button

I have a Next button on each slide, but would like to allow the learner to use the Enter key to automatically press click it. Unfortunately On Key Press is not a supported event for a button.
I’ve attempted so set the button focus using Javascript when the slide loads, but I haven’t had any luck with that either: Example code
prez.object(“btnNext”).focus();

Any suggestions as to how I can allow the Next button to click upon a learner hitting the Enter key, or to set focus to the Next button?

Thank you

Roger

Hi Roger,

The button On Click event will be triggered when you click on it, or press Enter or Space when it’s focused. So you don’t need to bind key event to it. To set the button focus, you can use the following code:

prez.object('btnNext').node.focus();

If you want to go to the next slide when the Enter key is pressed, despite the button is focused or not, please use Key Stroke object with the following event-actions:

keystroke

Regards

Ah yes, thank you. I’m learning so much so fast, being only my third day in ActivePresenter and JavaScript both. It’s baptism by fire as I put together a project.

I’m sure I will have more questions, and I promise I will do as much reading and research on my own as I can. However, I appreciate the help I get here so very much. There will be more.

Roger