Text Entry Fields and Press a Key Trigger

Mar 06, 2017

Hello - I'm working on a course where I have two text entry fields on one slide. I have also set up a trigger for each so that when a user presses a key (enter) on the text entry object a specified layer shows. However, this doesn't seem to be working as expected. When I've selected the specific text entry object and press enter, both layers appear instead of just the specified layer for pressing enter on that object. Any thoughts on how I can make it show just the layer associated with pressing enter on the particular text entry object?   

7 Replies
Maria Hoepf

Hi Ashley,

I pulled the part out of my course that I'm referencing into the attached .story file. As you can see, if you click in one of the text entry fields and press enter, both layers appear. However, I would only like the one layer associated with pressing enter on the text entry field to appear. Thoughts?

Ashley Terwilliger-Pollard

Hi Maria,

I see you're using some triggers to adjust the state to normal, hover and selected and I suspect that's impacting the odd behavior you're seeing. I'd look at letting the states behave based on their definitions here and then build on top of that what additional elements you need  - but triggering items that match the existing state definitions is known to cause problems. 

Maria Hoepf

Hi Ashley,

What I was hoping to achieve by using the triggers to adjust the states was to make it appear as though the text entry fields were being selected or hovered over. Since states cannot be applied to a text entry field, I added a rectangle directly underneath the text entry field. The rectangle won't automatically change to hover or selected since the text field is on top of it; so, I added triggers so that when a users hovers over the text entry field, the rectangle behind it changes to hover.

However, for the sake of troubleshooting, I did go ahead and remove these triggers from the attached file. It appears I'm having the same issue as before where pressing enter on one of the text entry fields causes both layers to show instead of just the specified layer associated with the particular field. Perhaps am I just pushing the limits of the software's capabilities by trying to do this?

Ashley Terwilliger-Pollard

Thanks Maria - stripping it down also helped me see it easier. What's happening is that the enter key is going to trigger both layers based on the press happening on that slide (even though you associated it with an object). To have this set up, you'll need to track it with a variable as a condition. Do you know what the user will be entering or have an idea at least? I did a pretty basic  on condition that the variable for each text entry wasn't blank (meaning the user entered something in it). This will work for the first text entry that they do, but the second one will also show the layer as again the user will have entered text. 

Maybe it'll help to take a look at what I've done so far and then you can further customize from there? 

Maria Hoepf

So if I'm understanding correctly, the "when user presses a key" trigger is not actually specific to the object it is associated with unless further conditions specific to that particular trigger are listed through variables.

Ideally the user would be entering the name of the individual (in last name, first name format) given them in a provided example. However, I'm trying to come as close as possible to matching the functionality of the system for which I'm creating the course. This functionality is what I would call a lookup field where the user can type anything (or nothing at all) and, when they press enter, a list of results appear. It would be nearly impossible to actually have the list of results match whatever they may decide to type in; so, my thought was that I would make a set list of results appear when they either press enter with nothing entered or press enter with text entered.    

Ashley Terwilliger-Pollard

Hi Maria,

Correct - since the object is on the slide and the key press is also happening on the slide, it'll trigger both events unless there is another variable/condition associated with it. Perhaps instead you could look at showing the layers when the user hovers their mouse over each item - add in a hotspot to show the layers based on the mouse hovering over that? A few different ways to get you closer to what you're looking to achieve and hopefully the community will weigh in with some ideas as well! 

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