Forum Discussion
Function Keys Interactivity in Storyline Using JavaScript
Hi Brandon! I was able to get them to work with Storyline 360. It does stink that you have to upgrade to the newer version to get those to work but once I did it worked great!
Woah?! What?! Can you give me some more details on this, please?!
This may be helpful for my organization to have an incentive to get the upgrade to 360!
- OwenHolt7 years agoSuper Hero
No need to upgrade, I tested in SL2 and it works there as well. See the attached SL2 file where I have disabled keys F1 through F12 and added an action to each key to show a different layer.
The JS code I used is a series of else if statements:
document.onkeydown = function (e) {
if(e.which == 112){
return false;
} else if(e.which == 113){
return false;
} else if(e.which == 114){
return false;
} else if(e.which == 115){
return false;
} else if(e.which == 116){
return false;
} else if(e.which == 117){
return false;
} else if(e.which == 118){
return false;
} else if(e.which == 119){
return false;
} else if(e.which == 120){
return false;
} else if(e.which == 121){
return false;
} else if(e.which == 122){
return false;
} else if(e.which == 123){
return false;
}
}- BCHarper7 years agoCommunity Member
Owen - I appreciate the assist on this one. I downloaded the attached file, published, zipped, and sent to tempshare to see how it was working. When I went to the tempshare link, the functions are not working in Chrome. It does look like this will work in Internet Explorer with the one note that you added about F1. Every time F1 is selected, the player does perform the action within the course, but it also opens help in Internet Explorer every time. I was happy to see how this works without issue for all of the other F-keys! THANK YOU!!! Every other attempt I had just didn't work.