Key shortcut for this menu item.
When user presses indicated Key (if it's not K_None) or CharKey (if it's not #0) then DoClick will be called (which results in TCastleWindowCustom.EventMenuClick, and TCastleWindowCustom.OnMenuClick, if DoClick returns false).
Handling of menu key shortcuts is completely within the CastleWindow (usually, it's even done by the underlying backend like GTK or WinAPI). You will not get EventPress (OnPress) messages for keypresses that translate to menu clicks. Although TCastleWindowCustom.Pressed.Keys will be still appropriately updated.
Note that Caption of this object should not contain description of Key or CharKey . The backend will automatically show the key description in an appropriate way.
You should use at most one of these properties, not both. So either use Key or CharKey , and leave the other one at default value (Key = K_None, CharKey = #0).
The CharKey values within range CtrlA..CtrlZ mean that user must press the given letter with Ctrl modfier. This rule includes some special chars like
The CharKey values above do not mean the backspace or tab or enter keys, they mean the combination of Ctrl key + respective letter. If you want to have backspace/tab/enter keys to activate the menu item, use Key = K_BackSpace, Key = K_Tab or Key = K_Enter.
TODO: for now, this must be assigned before adding this menu item to parent (actually, before the parent menu is added to window MainMenu) to work reliably. Don't change this property afterwards. Usually, you will set this property by an argument to the constructor.
|