Setting a Variable

Is it possible to set a variable typed into a data input box some other way than when control loses focus? The reason I ask is I have project set to navigate either with buttons or keyboard arrows. When you click the button the control loses focus from the data input text box. However if you use the keyboard arrows to navigate the variable is not updated.

7 Replies
Mark Woolwine

Thanks Phil... I think its just going to be easier for me to change my design. I was trying to building in navigation for someone who doesnt want to use or cant use a mouse. 

What I am trying to do is have a layer pop up that needs an answer before the learner can move on. They must type in a response. The response is then "graded." If correct it moves to next slide, if not another layer pops up telling them its incorrect and they need to go back and review the slide. With keyboard navigation, it doesnt seem possible to set the variable to the typed value if they push the right arrow key to go on. Even with the correct answer typed in the box it gives the failure layer.

Sarah Bennett

Hi, I know this thread is very old but I thought I'd share my thoughts in case someone else stumbles across this thread looking for answers like I did. From reading all the threads it became apparent that we need something to take the focus off the text box so that it sets the data entered into the variable associated with it. Therefore, I did a bit of experimenting and the best way I have found to get around this is to add a layer to your slide that is there purely to take the focus away from the text box. To make it work, set a trigger on your text/data entry field to show the 'invisible layer' when the user presses the Enter key (this must be below the one about setting data when control loses focus). Then, on your invisible layer, add a trigger to jump to the next slide (or specific layer or wherever you want it to go to next) once the timeline reaches 0.25s. Once the invisible layer "shows" then "hides" itself the focus goes elsewhere. If this doesn't work on its own, insert a data entry field (which will be redundant but just there to serve a purpose) on the "invisible" layer to make the cursor go to it temporarily. Hope this makes sense and helps others, Sorry, I can't share a file or screen shot since my module has sensitive data on it.