Forum Discussion
Function Keys Interactivity in Storyline Using JavaScript
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.
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.
- OwenHolt7 years agoSuper Hero
Add a trigger to execute JavaScript when your slide timeline starts. Copy and paste the code into the JavaScript code window in StoryLine. Once published, the function keys should become disabled when the slide timeline starts.
- MorganJohnson-b8 months agoCommunity Member
Hi Owen, do you have the script that would do this?