How to Add Alt Keyboard Shortcut in Application Run-Time Menu Bar?

Updated Nov 17, 2023

Environment

Software

  • LabVIEW

 When creating application custom runtime menu bar, the shortcut's text box only accepts <Cltr> or <Shift> keys. This section describes how to integrate <Alt> shortcut key into your custom runtime menu bar. 

  1. On the front panel of the VI for which you want to create a run-time menu, open the menu editor by selecting  Edit>>Runtime Menu.
editRTM1.png
  1. In the menu editor, set the menu type to <Custom> and the item type to <User item>.
editRTM2custom23.png
 
  1.  Set an item name and an item tag for your menu.
For this example, we will create a menu called Option (O) with multiple sub-menus, all accessibles with keyboard shortcuts.
The Option(O) menu will be acccessible with keyboard <Alt> shortcut. To anable the <Alt> key shortcut on this menu, add an underscore bar (_) in front of the letter to be used together with <Alt> key ("O" in this example).
※At runtime, this underscore bar will appear under the letter it precedes .

editRTM3 OptionO.png
  1. (Optional) To add a sub-menu
    1. click the plus(+) button.
    2. click the right arrow.(→)
    3. Enter an item name(c) 
    4. edit the item tag(d),  if necessary.
    5. click inside the <Shortcut (enter key component)> text box and, press a letter on the keyboard to set the sub-menu shortcut.
      In this example, by pressing the keyboard <C> letter , <Ctrl+C> will be registered as the shortcut for this sub menu.
      Pressing keyboard <Shift+C>, will register <Ctrl+Shift+C> as the shortcut for this sub men.

*This <Shortcut (enter key component)> text box can only accept <Ctrl> and <Shift> keys.

editRTM4 add copie (1).png
  1. You can add other sub-menus by repeating steps 4-a, 4-c~e.
editRTM5 Allsubmenu.png
 
  1. Select File >> Save , to save thecreated custom runtime menu. Runtime menus are saved as .rtm files.
editRTM6 savemenu.png
  1. close the menu editor (X) and select <yes>
editRTM6 savemenu2.png
 

While your application is running, pressing keyboard shortcut <Alt+O> expands the Options (O) menu as below.
editRTM8 runVI.png