I know there is a trigger that can be fired when a uses presses a particular key, or combination of keys, but I was wondering can you set a trigger to exclude a particular key press, for example
Change state of an object when the user presses any key but Y
If anyone has any ideas I'd be interested to hear them (even if it does include javascript )
Kinda clunky but one way to do it is set up triggers for each key except the one you want to exclude - Change state of object to new state when user presses Q, Change state of object to new state when user presses W, Change state of object to new state when user presses E etc. You'd have to copy paste triggers for each key on the keyboard :-/
If your context is a bit more complex, you could use a Boolean variable (adjust variable to true if an [allowed] key is pressed, adjust to false if [disallowed] key is pressed, and then change state if variable is true)...
Helen, I'd like to know how to trigger an action based on a combination of key strokes. How have you made this work? Do you mean only certain key combinations like 'Shift+something' or can you actually trigger an action based on a series of key strokes?
I know this is an older discussion but it was never answered. I am looking for something similar. I have a hotspot where the user needs to click on the delete key. This is working as expected. I want a try again layer to show if they press any other key. I am not sure how this can be done without creating a trigger for every single key on the keyboard. I really was hoping for an easier solution. I have tried using a boolean variable but again not sure how to change the variable to show the try again layer.
Have you seen the information here in terms of using the hotspot question? How many attempts have you set? If you've only set it for one they likely only see the "incorrect" layer and if you're using more than one attempt or have enabled other "false" hotspots - you could include it to show them the try again layer based on what they clicked.
I am familiar with how to create a hotspot question but not sure how this helps. I am not looking where the user is clicking but when they press a key. They need to press the delete key. I want the incorrect layer to show up if they press any other key besides the delete key. I thought a hotspot will only happen if the user clicks outside the hotspot.
My apologies - I read that if the click on the delete key in connection with your hotspot, so when you said press another key I assume they were still doing that on the slide vs. using their physical keyboard.
I'll defer to the community for additional ideas based on your set up.
6 Replies
Kinda clunky but one way to do it is set up triggers for each key except the one you want to exclude - Change state of object to new state when user presses Q, Change state of object to new state when user presses W, Change state of object to new state when user presses E etc. You'd have to copy paste triggers for each key on the keyboard :-/
If your context is a bit more complex, you could use a Boolean variable (adjust variable to true if an [allowed] key is pressed, adjust to false if [disallowed] key is pressed, and then change state if variable is true)...
Helen, I'd like to know how to trigger an action based on a combination of key strokes. How have you made this work? Do you mean only certain key combinations like 'Shift+something' or can you actually trigger an action based on a series of key strokes?
Thanks
I know this is an older discussion but it was never answered. I am looking for something similar. I have a hotspot where the user needs to click on the delete key. This is working as expected. I want a try again layer to show if they press any other key. I am not sure how this can be done without creating a trigger for every single key on the keyboard. I really was hoping for an easier solution. I have tried using a boolean variable but again not sure how to change the variable to show the try again layer.
Hi Alan,
Have you seen the information here in terms of using the hotspot question? How many attempts have you set? If you've only set it for one they likely only see the "incorrect" layer and if you're using more than one attempt or have enabled other "false" hotspots - you could include it to show them the try again layer based on what they clicked.
I am familiar with how to create a hotspot question but not sure how this helps. I am not looking where the user is clicking but when they press a key. They need to press the delete key. I want the incorrect layer to show up if they press any other key besides the delete key. I thought a hotspot will only happen if the user clicks outside the hotspot.
Hi Alan,
My apologies - I read that if the click on the delete key in connection with your hotspot, so when you said press another key I assume they were still doing that on the slide vs. using their physical keyboard.
I'll defer to the community for additional ideas based on your set up.
This discussion is closed. You can start a new discussion or contact Articulate Support.