I’ve been looking into the interaction between the keyboard and menus in my apps. And I’ve noticed a few things that diverge from the “standard” way of doing things.
-
When a BMenuItem with a shortcut is triggered by the user pressing the shortcut keys, the menu item sends it’s command, but also the view with the focus receives the same key press as well. In my case this was causing the command to be executed twice in my edit control. Things like cut and copy have handlers in the OnKey as in some cases it’s used in an app without Edit->Cut/Copy menus and still has to function as you’d expect. But in an app WITH a menu that has Edit->Cut/Copy the commands were running twice because unlike all the other OS’s Haiku doesn’t “eat” the keypress at the menu level. Or maybe I’m doing it wrong. Haha. Is that expected behavior?
-
The Menu key. In Win/Linux/Mac the menu key on the keyboard will send a key event to the window with the focus. The application will then be able to show a context menu. In Haiku however the system doesn’t send the key event to the application and just shows the deskbar menu. And the “Windows” key (at least on my keyboard) does nothing (maps to ‘Option’ in the keymap). That’s the key that should bring up the system menu. This is in the context of my vmware install and I’m using the US-international keymap. Is there some way to give the app that key?