4D v13.4SET MENU ITEM SHORTCUT |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
SET MENU ITEM SHORTCUT
SET MENU ITEM SHORTCUT
The SET MENU ITEM SHORTCUT command replaces the shortcut key associated with the menu command specified by menu and menuItem, by the character whose character code or text is passed in itemKey. You can pass -1 in menuItem in order to indicate the last item added to menu. This key is combined with the Ctrl (Windows) or Command (Macintosh) key in order to set the new keyboard shortcut. You can pass the letter indicating the shortcut key in the itemKey parameter, for example “U” to specify the Ctrl+U (Windows) or Command+U (Mac OS) shortcut. You can pass additional modifiers to associate with the shortcut in the modifiers parameter. This way you can define shortcuts like Ctrl+Alt+Shift+Z (Windows) or Cmd+Option+Shift+Z (Mac OS). You can pass the following values in modifiers:
Note: You can specify the value to pass using the Command key mask, Shift key mask and Option key mask constants of the Events (Modifiers) theme. The Ctrl (Windows) and Command (Mac OS) keys are automatically added by 4D to the keyboard shortcut, regardless of whether or not you explicitly indicate it in the modifiers parameter. So you do not have to add the value 256 to this parameter, unless this key is the only modifier, in which case you must pass either the value 256 or the corresponding constant in modifiers. Note: For compatibility, the command also accepts a character code in the itemKey parameter (former syntax). In this case, the modifiers parameter is not taken into account and can be omitted. The shortcut is only associated with the Ctrl (Windows) or Command (Mac OS) key. If you omit the process parameter, SET MENU ITEM SHORTCUT applies to the menu bar for the current process. Otherwise, SET MENU ITEM SHORTCUT applies to the menu bar for the process whose reference number is passed in process. Note: If you pass a MenuRef in menu, the process parameter serves no purpose and will be ignored. If you pass 0 (zero) in itemKey, any shortcut is removed from the menu item. Definition of the Ctrl+Shift+U (Windows) and Cmd+Shift+U (Mac OS) shortcut for the “Underline” menu item: SET MENU ITEM(menuRef;1;"Underline") Definition of the Ctrl+R (Windows) and Cmd+R (Mac OS) shortcut for the "Restart" menu item: INSERT MENU ITEM(FileMenu;-1;"Restart") |
PROPERTIES
Product: 4D
INDEX HISTORY
Modified: 4D v11 SQL SEE ALSO
Get menu item key |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||