Keyboard triggers: press Enter to continue, lose focus, set focus
Build "press Enter to continue" with a key press trigger, check an answer when the learner tabs away (lose focus), and move keyboard focus with Set focus. Storyline names, step by step.
Last updated 4 min read
How do I make a slide respond to a key, the way Storyline's "when user presses a key" does?
Step by step
Add a trigger to any object on the slide
Select an object (a text box is fine), open Triggers and click Add Trigger. Click the sentence to open it.
Pick the key press event
Click When and type "key". Pick When user presses a key.
Press the key
Click in the Key box and press Enter. It records
Enter. Leave Listening on Anywhere on the slide.Keep the action
Leave Then as Go to next slide.
Try it
Click Preview and press Enter. The next slide opens.
What you'll build
A slide that says "Press Enter to continue" and means it. Then two smaller keyboard tricks: checking an answer when the learner leaves a field, and moving focus to the right place for keyboard and screen reader users.
Press Enter to continue
- Add a Text box: "Press Enter to continue".
- With it selected, open Triggers and click Add Trigger. Click the sentence to open it.
- Click When, type "key", and pick When user presses a key.
- Click in the Key box and press Enter. The box shows the key. Press a different key to change it, or click Clear.
- Leave Listening on Anywhere on the slide. That is Storyline's "Player" option.
- Leave Then as Go to next slide.
The sentence reads When user presses Enter → go to the next slide.
Tip: Modifiers work too. Hold Shift, Ctrl or Alt while you press the key and the box records shift+Tab or ctrl+s.
Why it doesn't fire while someone is typing
A slide-wide key trigger stays quiet while the learner is typing in a text field. Otherwise pressing Enter or the letter "a" in an answer box would jump the slide.
If you want the key to work only while one object has focus, set Listening to that object. Click the target icon next to the list and then click the object on the slide, or pick it by name.
Your key wins over the player's own keys. If you bind the right arrow, the player's "next slide" arrow gives way on that slide.
When a control loses focus
Storyline's "when control loses focus" is When a control loses focus here. It fires when the learner tabs or clicks away from the object you pick under Object.
Typical use: add a Text entry from the toolbar and, in its Style tab, pick the text variable it Writes to. Then add a trigger with this event, a condition on that variable (or on its Input value), and show a "Check your spelling" layer Otherwise.
Set focus
Set focus moves keyboard focus to an object. Screen readers read it out. Use it after you show a feedback layer, so a keyboard user lands on the feedback instead of being left behind on the button.
Add it as the last action of the trigger that shows the layer: Then → Set focus → (the feedback text box).
Try it
Click Preview. Without touching the mouse, press Enter: the next slide opens. Press Tab to move through the buttons and check that focus lands where you expect after each one.
Part of the documentation: Build.
Found something here that does not match what the product does? That is a bug in the guide — see all guides or tell us from the Help Center.