selectable-menu-item<%> : interface? | ||
|
(send a-selectable-menu-item command event) → void? |
event : (is-a?/c control-event%) |
If the menu item has no shortcut, #f is returned.
The shortcut part of a menu item name is not included in the label returned by get-label.
For a list of allowed key symbols, see get-key-code in key-event%, except that the following are disallowed: 'shift, 'control, 'numlock, 'scroll, 'wheel-up, 'wheel-down, 'release, and 'press.
(send a-selectable-menu-item get-shortcut-prefix) |
→ (listof (one-of/c 'alt 'cmd 'meta 'ctl 'shift 'option)) |
'alt —
Meta (Windows and X only) 'cmd —
Command (Mac OS X only) 'meta —
Meta (Unix only) 'ctl —
Control 'shift —
Shift 'option —
Option (Mac OS X only)
On Unix, at most one of 'alt and 'meta can be supplied; the only difference between 'alt and 'meta is the key combination’s display in a menu.
The default shortcut prefix is available from get-default-shortcut-prefix.
The shortcut key, as determined by get-shortcut, matches a key event using either the normally reported key code or the other-Shift/AltGr key code (as produced by get-other-shift-key-code in key-event%, etc.). When the shortcut key is a key-code symbol or an ASCII letter or digit, then the shortcut matches only the exact combination of modifier keys listed in the prefix. For character shortcuts other than ASCII letters and digits, however, then the shortcut prefix merely determines a minimum set of modifier keys, because additional modifiers may be needed to access the character; an exception is that, on Windows or Unix, the Alt/Meta key press must match the prefix exactly (i.e., included or not). In all cases, the most precise match takes precedence; see map-function in keymap% for more information on match ranking.
An empty list can be used for a shortcut prefix. However, the default on-menu-char in frame% method checks for menu shortcuts only when the key event includes either a non-Shift modifier or a Function key. Thus, an empty shortcut prefix is normally useful only if the shortcut key is a Function key.
If the shortcut character is set to #f, then menu item has no keyboard shortcut.
(send a-selectable-menu-item set-shortcut-prefix prefix) |
→ void? |
prefix : (listof (one-of/c 'alt 'cmd 'meta 'ctl 'shift 'option)) |