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:
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 macOS, i.e. you'd have to
specify Ctrl+V
for paste on Windows and Linux and Cmd+V
for paste on
AmigaOS and macOS. Since this generates unnecessary overhead, Ctrl
is treated
as a special key which is mapped to the system's default menu shortcut modifier key.
Ctrl
instead, RapaGUI will listen to the command key on AmigaOS and macOS
(see above for details). On Windows and Linux RawCtrl
is identical to Ctrl
.
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.