setShortCutKey

setShortCutKey(key:   Character;
               flags: Integer);

The setShortCutKey method of the MenuItem class enables you to set the shortcut key displayed for a menu item at run time in your JADE system with the values specified in the key and flags method parameters.

The value of the key parameter must be one of "0" through "9", "A" through "Z", J_key_F1 though J_key_F12, J_key_Delete, J_key_Insert, J_key_Back, J_key_UpArrow, or J_key_DownArrow. (The J_key_ values are global constants in the KeyCharacterCodes category.)

The value of the flags parameter can be zero (0) if there is no shortcut flag or it can be a combination of the following MenuItem class constants.

Constant Bit Value Description
ShortCutFlag_Alt #10 The Alt key must also be pressed
ShortCutFlag_Ctrl #8 The Ctrl key must also be pressed
ShortCutFlag_Shift #4 The Shift key must also be pressed

The method generates an exception if the parameters are invalid.

The code fragment in the following example displays Shift+Ctrl+Alt+Delete as the menu accelerator.

menu1.setShortCutKey(J_key_Delete.Character, MenuItem.ShortCutFlag_Alt + 
                     MenuItem.ShortCutFlag_Ctrl + MenuItem.ShortCutFlag_Shift);

2018.0.01 and higher