| 4D v15.4Get menu item key | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v15.4
 Get menu item key 
         | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Get menu item key ( menu ; menuItem {; process} ) -> Function result | ||||||||
| Parameter | Type | Description | ||||||
| menu | Longint, MenuRef |   | Menu number or Menu reference | |||||
| menuItem | Longint |   | Menu item number or -1 for the last item added | |||||
| process | Longint |   | Process reference number | |||||
| Function result | Longint |   | Character code of standard shortcut key associated with the menu item | |||||
The Get menu item key command returns the code of the Ctrl (Windows) or Command (Macintosh) shortcut for the menu item whose menu number or reference is passed in menu and whose item number is passed in menuItem. You can pass -1 in menuItem in order to indicate the last item added to menu.
If you omit the process parameter, Get menu item key applies to the menu bar for the current process. Otherwise, Get menu item key 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 the menu item has no associated shortcut or if the menuItem parameter designates a hierarchical submenu, Get menu item key returns 0 (zero).
To obtain the shortcut associated with a menu item, it is useful to implement a programming structure of the following type:
 If(Get menu item key(mymenu;1)#0)
    $modifiers:=Get menu item modifiers(mymenu;1)
    Case of
       :($modifiers=Option key mask)
          ...
       :($modifiers=Shift key mask)
          ...
       :($modifiers=Option key mask+Shift key mask)
          ...
    End case
 End if
	Product:  4D
	Theme:  Menus
	Number:  
        424
        
        
        
	
	Modified:  4D v11 SQL  
	
	
	
	
	4D Language Reference ( 4D v15.4)
	
	
	
	4D Language Reference ( 4D v15)
	
	
	
	
	
	
	
	4D Language Reference ( 4D v15.3)
	
	
 Add a comment
Add a comment