Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Sets the receiver's unmodified key equivalent.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Menu | 4.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
Parameter | Description | Example |
---|---|---|
item | The reference to the menu item. Please create one with MenuItem.CreateMenuItem or MenuItem.CreateSeparator. | $item |
text | A string containing a character code representing a keyboard key. If you want to remove the key equivalent from a menu item, pass an empty string. | "T" |
Returns OK or error.
Add menu item with key ⇧⌘T:
# set useful constants:
Set Variable [$ShiftKeyMask; Value:131072]
Set Variable [$ControlKeyMask; Value:262144]
Set Variable [$AlternateKeyMask; Value:524288]
Set Variable [$CommandKeyMask; Value:1048576]
#now make menu entry
Set Variable [$item; Value:MBS("MenuItem.CreateMenuItem"; "With Key Equivalent")]
Set Variable [$r; Value:MBS("MenuItem.SetKeyEquivalent"; $item; "T")]
Set Variable [$r; Value:MBS("MenuItem.SetKeyEquivalentModifierMask"; $item; $ShiftKeyMask + $CommandKeyMask)]
Set Variable [$r; Value:MBS("Menu.AddItem"; $menu; $item)]
Created 18th August 2014, last changed 15th April 2015
MenuItem.SetItalic - MenuItem.SetKeyEquivalentModifierMask
Feedback: Report problem or ask question.