keyboard in context menus
Enno Rehling <[email protected]> Tue, 11 Jul 2023 20:45:58 +0200
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
my application creates context menus with FXMenuPane when a list item is
right-clicked, like so:
FXMenuPane pane(this);
new FXMenuCommand(&pane, "&Foo", nullptr, this, ID_FOO);
new FXMenuCommand(&pane, "&Bar", nullptr, this, ID_BAR);
pane.create();
pane.popup(nullptr, event->root_x, event->root_y);
getApp()->runModalWhileShown(&pane);
This works as long as I select the menu items with the mouse, and the
menu can be closed by clicking out of bounds. However, there is no
keyboard navigation. I can neither navigate the menu with the arrow
keys, nur can I use the F and B accelerators, or close the menu with
ESC. Pressing any key results in an application beep. How can I fix this?
And in a related question, what is the fxkeys.h constant for the menu
key (or application key) on a Windows keyboard? The one that opens
context menus, and was introduced with the Windows keys. It's not
KEY_Menu, that one seems to be from some legacy keyboard.
Enno.