Forum Discussion
Built In Keyboard Shortcuts
Looking for some insight on how to set up a course for a keyboard user that could have keyboard shortcut to access the menu of the course at any time vs having to tab through until they get to the menu. Any insight would be greatly appreciated.
1 Reply
- HoneyTurnerCommunity Member
So you're looking for a keyboard shortcut to set the focus on the first item in the menu?
I suspect you'll need to use the built in trigger:
When user presses (chosen keyboard combo), execute JavaScript.I have not played with setting focus via JavaScript, but I have used JavaScript to change the words in the menu.
let elements = document.getElementsByClassName("linkText");
elements[0].innerHTML = "This is the first scene name";
elements[1].innerHTML = "This is the second slide/scene name";
elements[2].innerHTML = "This is the third slide/scene name";
So, my best guess to get it to jump to the title of the first scene:
let elements = document.getElementsByClassName("linkText");
elements[0].focus();
Presuming that works, you could start them at any point in the menu just by replacing the number to match its placement in the menu. Notice scenes and slides are all mashed into a single numbering system, starting at 0.
I'd be curious to know if this works for you.
Related Content
- 1 year ago