Keyboard Navigation without Tab Key?

nkummert8322 Community Member Posts: 7
Hello all,

I am designing a course for an environment where participants can only interact with the content via a custom keypad provided onsite. There is no mouse or touch input available. I have mostly been fine within these constraints but am running into trouble when laying out things like multiple choice questions.

Ideally participants would use the up and down arrow keys to move a cursor and select their answer, and then use the enter key to submit it. The problem is, these custom keypads don't have a "tab" key, so native keyboard navigation through the content is not an option.

Is there any way I can configure my Lectora project to enable this kind of functionality?


  • cmooraces
    cmooraces Community Member Posts: 25 ♪ Opening Act ♪
    You can use an on key stroke action to set the variable of the question. So if you hit "a" on the keyboard, the action could be set to make the variable of the question be the value of the first answer. But you have to program the action for each answer AND program it uniquely on each page that has a question as the variables are different. But you can copy the page and then just reset the question variable and the actions. So you have a bit of a baseline.

    It's easiest if you make the actual answers of the questions be a,b, c, d and then use a text box for the answers that is NOT part of the question. That way you can just set the variable of the question to a,b,c,d.

    Additionally, this will not show the selection on the page. So the radio button won't be filled. But the variable WILL be filled and if the page was reloaded, the radio button would be selected. A unique way to present the question is to set the radio buttons to not initially visible and use a graphic like a check mark to display when the keystroke is hit. This would require two actions for every answer; one to set the variable and another to show the checkmark.

    Hope this helps.
  • nkummert8322
    nkummert8322 Community Member Posts: 7
    Thanks for the reply! I should have mentioned that I did try something similar to that, where an arrow key was assigned to "select" an answer, and the enter key was used to submit it (see below for UI example). This functioned just fine, but several users in testing reported being confused and wanted a simple cursor that moved when the arrow keys were pressed to select the answer.
  • carlfink
    carlfink Community Member Posts: 842 ☆ Superstar ☆
    EDIT: can someone from Trivantis fix the editor in this forum? See below for why I ask.


    You could actually create an "onKey" action for UpArrow and for DownArrow that tests the item variables. Say the choices are VarA, VarB, and VarC (where True means selected). The pseudocode for DownArrowwould be:

    if VarA
    <p style="padding-left: 30px;">VarB=True</p>
    <p style="padding-left: 30px;">VarA=False</p>
    elseif VarB
    <p style="padding-left: 30px;">VarC=True
    elseif  !VarC
    <p style="padding-left: 30px;">VarA=True</p>
    \\If VarC is true, the key is ignored, there is no choice below option C

    For UpArrow, it would be the equivalent but with the "ignore" condition being when A is selected.

    Sorry this is formatted wrong. This editor is terrible when I try to do indentation--if I change the font it refused to indent.
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!