additional control buttons of the keyboard

  • We have control buttons by default: Shift, Ctrl, Up, Down, Left, Right.

    Is it possible to use additional buttons of the keyboard for navigation in a tour?

    F - on/off FullScreen mode
    A - open/close ABOUT textfield
    H - open/close HELP textfield
    C - open/close COPYRIGHT textfield
    1 - open/close 1st map
    2 - open/close 2nd map
    etc.

  • Hi,

    yes, there is the onkeydown event and the keycode variable for that,
    e.g.

    Code
    <events onkeydown="checkkey();" />
    
    
    <action name="checkkey">
      trace('keycode=', keycode);
      if(keycode == 70, switch(fullscreen));
      if(keycode == ??, ...);
      ...
    </action>

    open the log ('O'-key) to find out the keycode of the current pressed key (see the trace action),
    and then make a if() and check for the key you want to do something...
    but note - in fullscreen mode - only a few keys are working (esc, cursors keys, ...)

    best regards,
    Klaus

  • I have set new value, but this button carries out both actions: "zoom in" & "open about textfield"

    Code
    <!-- A - open about textfield -->
      if(keycode == 65, "action(show_about_field); action(hidehelp,helptext); action(hidecopyright,copyrighttext);");

    The code control keycodesin="16,107" has not helped
    ---------
    It works, when the code <control keycodesin="16,107" /> is in the main XML file.

    many thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!