Move slider with mouse or arrow keys
Aug 19, 2015
Hi elearning heroes.
I made a course with a slider page. It has 4 layers plus the base layer and as you move the slider, a new layer displays. You have to view all 4 "extra" layers to advance to the next slide.
The slider and slide works perfectly using the mouse to advance the slider.
My internal client was concerned because some of our users have laptops with trackpads and found it difficult to drag the slider with a trackpad. So I got a simple request, can I add "arrow key" functionality too.
Seems simple, right?
Well I have it working by adding a slide trigger to adjust the slider variable when the user presses the right or left arrow key.
But... if the user move the slider out of the default and then back to the default starting position using the arrow keys, the slider gets "stuck" and doesn't respond to more arrow key presses. It does respond if I use the mouse.
I've attached a .story file so you can see what I mean. The mouse always works, but they key presses get lost somewhere.
Any help would be appreciated!
14 Replies
I added conditions to the RightArrow and LeftArrow triggers so that the slider variable is only increased/decreased if it is >0 and <4. See attached file, that seems to work consistently.
John, one thing you should do is ensure the slider value never gets out of range; that is, you don't want it to ever be less than zero or greater than 4. To do this, add a condition to each of your keypress triggers. (Add 1 to Slider2 *IF* Slider2 is less than 4. Subtract 1 from Slider2 *IF* Slider2 is greater than 0.)
Hi gentlemen
I see Michael's changes, and he did what Steve suggested, but I still get the same behavior.
Here is what I'm doing with Michael's story:
In your message above, John, I assume you mean Right arrow 4 times, Left arrow 4 times, then Right arrow once, right? (Seems you have your Left and Right backward in your three bullets above.)
Anyway, I tried Steve's file and it works for me in Preview mode.
Oh yeah, I had it backward.
Here is what I'm doing with Michael's story:
Wow, Steven, in Michael's .story file I still get locked following the steps above. How odd.
I tried again and for me it works like a charm. I'm on SL2, Update 6 (maybe that makes a difference).
I'm on SL2 update 4 for now, so that might be the issue.
We got update 6 running through the approval process to get it deployed, so this might be a problem that gets solved automatically.
Thanks for the help, heroes!
Keep us posted. Update 5 fixed a bunch of slider issues, see here.
Yes, I'm on Update 6 as well.
John, just for kicks, try publishing Michael's file to see if it works that way as opposed to just previewing it.
Publishing the file doesn't matter, same behavior. But I can wait until I get version 6 for this to be fixed, so it's not a biggie.
Thanks!
Hi John,
It looks like they've got your covered here with files and regarding the update, but definitely let us know once you've got the update if the behavior persists.
Just a note to follow up: publishing the file in Update 6 fixed this issue. No changes were required in the .story file.
Thanks, everyone!
Perfect - thanks for the update John!
This discussion is closed. You can start a new discussion or contact Articulate Support.