Forum Discussion
Function Keys Interactivity in Storyline Using JavaScript
I have never been able to get that code to work when I put it in, but could be user error. However if you want to eliminate using java in your program the storyline 360 is the way to go. All I had to do was create a trigger to jump to the next page when user clicks F5 and its good to go! But it is good to know that it is a possibility to get done in S2!
- BCHarper7 years agoCommunity Member
Chelsea - If the function keys are all working for you with 360, that is amazing! When you publish your files, have you tested this function in Chrome and Internet Explorer? Our learners are split about 50/50 between these two browsers. With what Owen has helped with, it worked on IE, but not in Chrome. Additionally, with the F1 selection, does it open help? I sincerely appreciate any info you can provide on this.
- OwenHolt7 years agoSuper Hero
I'm using chrome and it works for me. Cross browser support is always tricky.
Try this code as an alternative to disable all of the function keys instead of what i listed before and see if you get a better result:document.onkeydown = function (e) {
var key = e.charCode || e.keyCode;
if (key >= 112 && key <= 123) {
e.preventDefault();
} else {
// non function key so do nothing
}
}See attached SL2 file with alternate code.
- davidtempleton7 years agoCommunity Member
Do we open the html file in note pad to make the change? Not sure where to go in note pad to in my case disable F1 and F4.