Slider progression based onkeydown

Hi everyone, I have a slider setup with a custom graphic and it slides perfectly using the mouse as expected, but I also have to have the keyboard arrows control the slider. This is possible, but unfortunately the arrow keys have to be repeatedly pressed for the slider to progress. Is there no way to have it detect that the arrow key is held down so that the slider can be updated as it's held?

I've managed to get a work around working with javascript, but it only works in chrome(IE and firefox are unresponsive).

Any suggestions are welcome.

 

10 Replies
Ashley Terwilliger-Pollard

Hi Jean-Guy,

I can't speak to the Javascript element, although you may want to share the code here in case anyone in the community could weigh in - but you mentioned it worked in Chrome, so I wanted to confirm that you were testing it within the intended publish environment as testing it locally could cause features of the content to not behave as expected. 

Jean-Guy  Boulay

Understandably an easy mistake to make, but I'm testing on a web server environment. It's strange because IE and firefox are catching the alerts, but not the keydown event. When I try the javascript on it's own in an html page I have success.

I've made a few discoveries since I posted. The most important being that event.keyCode is only recognized in <IE9 browsers. I can now get the HTML5 version of the published project to work in all browsers by detecting event.which. Unfortunately the flash version of the published project only works in Chrome. I attached a scaled down version of the project for your guys to test.

I'm suspecting that I might have to add a js script to the main story.html that exchanges info with the player. Not the ideal route.

Jean-Guy  Boulay

One thing I noticed is that the sliders don't work properly in firefox when viewing it in story_html5.html.  When it's debugged it says that the compiled_player.js has a deprecated function being called.

"Use of getPreventDefault() is deprecated. Use defaultPrevented instead."

The story.html version works fine.

Ashley Terwilliger-Pollard

Hi Jean-Guy,

You may want to review a site such as HTML5test.com to see how different elements and browsers will behave with HTML5 content. We've based our support on how those browsers interact with the Articulate HTML5 content to ensure the content works as expected within those environments.