5 Replies
Sam Hill

Hi Christina, unfortunately not. There is no IF/ELSE in Storyline. I would recommend looking to JavaScript for this solution as you would be able to program more efficiently. You can then communicate a result back to a Storyline variable called "enterpressed" to a value of either "Y" or "N" and show the feedback you would like. Make sure "enterpressed" has a value of "" to being with so you can detect a variable value change to either "Y" or "N".

Here's the JavaScript.

var player = GetPlayer();
document.addEventListener("keypress",function(e){
player.SetVar("enterpressed",(e.keyCode == 13 ? "Y" : "N"))
});

As mentioned, have a trigger that is looking for a variable change on "enterpressed" with an IF statement. If "enterpressed" = "Y" then enter key was pressed. Have another event looking for the value "N".

Hope that makes some sense?