4D v14.3

Get menu item modifiers

Home

 
4D v14.3
Get menu item modifiers

Get menu item modifiers 


 

Get menu item modifiers ( menu ; menuItem {; process} ) -> Function result 
Parameter Type   Description
menu  Longint, MenuRef in Menu reference or Menu number
menuItem  Longint in Number of menu item or -1 for the last item added to the menu
process  Longint in Process number
Function result  Longint in Modification key(s) associated with menu item

The Get menu item modifiers command returns any additional modifier(s) associated with the standard shortcut of the menu item designated by the menu and menuItem parameters.

The standard shortcut is composed of the Command (Mac OS) or Ctrl (Windows) key plus a custom key. The standard shortcut is managed using the SET MENU ITEM SHORTCUT and Get menu item key commands.

The additional modifiers are the Shift key and the Option (Mac OS) /Alt (Windows) key. These modifiers can only be used when a standard shortcut has been specified beforehand.

The number value returned by the command corresponds to the codeof the additional modifier key(s). The key codes are as follows:

  • Shift= 512
  • Option (Mac OS) or Alt (Windows) = 2048
    If both keys are used, their values are combined.

Note: You can evaluate the value returned using the Shift key mask and Option key mask constants of the “Events (Modifiers)” theme.

If the menu item does not have an associated modifier key, the command returns 0.

You can pass -1 in menuItem in order to specify the last item added to menu.

In menu, you can pass a menu reference (MenuRef) or a menu number.

If you pass a menu reference, the process parameter serves no purpose and will be ignored if it is passed.

If you pass a menu number, the command will take the corresponding menu in the main menu bar of the current process into account. If you want to designate another process, pass its number in the optional process parameter.

Example  

Refer to the example of the Get menu item key command.

 
PROPERTIES 

Product: 4D
Theme: Menus
Number: 980

 
HISTORY 

Created: 4D v11 SQL

 
SEE ALSO 

Get menu item key
SET MENU ITEM SHORTCUT

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)