Name
Menuitem.Shortcut -- set custom shortcut for menu item
Function
Set a custom shortcut for a menu item. Normally, menu item shortcuts are defined by just using the underscore character in the item title to designate a keyboard shortcut. See Keyboard shortcuts for details. There are however certain cases where this is not sufficient. First of all, by using the underscore character to declare a keyboard shortcut you are limited to characters which are part of the menu item's title. In many times, though, you will want to declare a shortcut that is not part of the item's title, e.g. the typical shortcut for "Paste" is Ctrl+V although there is no "V" in the word "Paste". This is where Menuitem.Shortcut can be used to set up arbitrary shortcuts for your menu items.

Additionally, this attribute is also useful for defining more complex shortcuts, e.g. Alt+F5 or Ctrl+Shift+X, etc. Defining such complex shortcuts isn't possible through the standard underscore route either, so you have to use Menuitem.Shortcut for it.

The string you specify here must be combination of modifiers and keys separated by + or - characters. The following modifiers and keys are currently recognized:

Ctrl
This specifies the control key on Windows and Linux and the command key on AmigaOS and Mac OS. The reason why this is mapped to the command key on AmigaOS and Mac OS is to make it easier for you to write portable code. On Windows and Linux the control key is the standard modifier key whereas AmigaOS and Mac OS use the command key as the standard modifier key. Thus, by specifying this modifier you will always get the system's default modifier key. If you need to use the real control key on AmigaOS and Mac OS, use the modifier key RawCtrl (see below). If RapaGUI didn't treat Ctrl as a special token, you'd always have to write separate code for Windows and Linux vs. AmigaOS and Mac OS, i.e. you'd have to specify Ctrl+V for paste on Windows and Linux and Cmd+V for paste on AmigaOS and Mac OS. Since this generates unnecessary overhead, Ctrl is treated as a special key which is mapped to the system's default menu shortcut modifier key.

Alt
Use the alt key as a modifier key.

Shift
Use the shift key as a modifier key.

RawCtrl
On AmigaOS and Mac OS this modifier key allows you to listen to the real control key. If you use Ctrl instead, RapaGUI will listen to the command key on AmigaOS and Mac OS (see above for details). On Windows and Linux RawCtrl is identical to Ctrl.

Up
Cursor up

Down
Cursor down

Right
Cursor right

Left
Cursor left

Help
Help key

Del
Delete key

Backspace
Backspace key

Tab
Tab key

Return
Return key

Enter
Enter key

Esc
Escape

Space
Space key

F1 - F16
Function keys

Insert
Insert key

Home
Home key

End
End key

PageUp
Page up key

PageDown
Page down key

Print
Print key

Pause
Pause key

Furthermore, you can also add English alphabet characters from A to Z as well as the numbers 0 to 9 to your shortcut specification.

Finally, please do note that specifying shortcuts using the underscore character and Menuitem.Shortcut are not mutually exclusive. You can actually specify both and on some systems (e.g. Windows) RapaGUI will even support both. For example, on Windows you can access menu items via the keyboard by first pressing Alt and then the underscore shortcut or you can also access menu items by pressing a predefined shortcut, e.g. Ctrl+V for paste. On systems which don't support both kinds of shortcuts, the shortcut specified in Menuitem.Shortcut will take precedence.

Type
String

Applicability
I


Show TOC