[haiku-3rdparty-dev] Menu Shortcuts..

  • From: "Matthew Allen" <fret@xxxxxxxxxxxx>
  • To: <haiku-3rdparty-dev@xxxxxxxxxxxxx>
  • Date: Sat, 15 Jun 2013 9:00:15 +1000

Hi,

So in my reading of the BeBook's handling of BMenuItem shortcuts:
- The B_COMMAND_KEY flag is assumed, and can't be "turned off".
- Only alpha characters are support for the "key" part of the shortcut.

There are several problems with this (for me). I want to be able to specify 
function keys as shortcuts.
e.g.
        F1 = Help
        F7 = Build
        etc

These don't need the M_COMMAND_KEY modifier. And don't seem to be supported 
anyway (I get little square boxes instead of F1 etc). In fact that restriction 
is quite specific to Haiku/Beos... no other OS forces you to have a modifier 
key.

I also want to bind a shortcut to "Ctrl + Shift + S", so using two other mods, 
but NOT B_COMMAND_KEY. On windows/linux it's "Alt + Shift + S", but because 
Haiku seems to swap the meaning of Ctrl and Alt compared to win/linux.

So in short (hur hur) I'm finding the shortcut system very limiting. I'll 
probably have to do some handling of shortcuts myself by hooking the 
KeyDown/KeyUp handlers of all my views and first checking if they match some 
unsupported shortcut. Which fortunately I have hooks available to do just such 
things. So it's not that painful, but still... it'd be nice to just have the 
right shortcut supported by the system itself instead of hacked on. Partly 
because the user will see the correct shortcut in the menu, i.e. it's 
discoverable.

Is there some way around these issues?

Regards
--
Matthew Allen


Other related posts: