[haiku-development] Re: Menu shortcuts without modifiers

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 11 Jan 2011 12:13:15 +0100 (MET)

Ryan Leavengood<leavengood@xxxxxxxxx> wrote:
> On Monday, January 10, 2011, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:
> > A B_NO_COMMAND_KEY makes definitely more sense IMO than B_NO_MODIFIERS;
> > in AddShortcut() you only need a mechanism to work-around the
> > command-modifier automatism, nothing else.
> That isn't quite true. [...]

If you wouldn't have managed to misunderstood me, it is quite true :-)
Read "AddShortcut()" again ;-)

> > BTW I don't know how shortcuts are stored right now, but I guess it's a
> > good idea to put them in a map, accessible by key - that should also take
> > care of your performance related worries.
> Yeah I had that idea, though it may not be needed (but it also
> probably would not hurt.) 

Chosing the right algorithm is almost never needed, it just might bring down 
computing times from infinity to not noticeable, see random sort :-))

[...]
> I would like to create a ShortcutManager class which holds all the
> shortcut logic [...]

Sounds definitely like the way to go to me, though that probably won't solve 
the duplication in BMenuItem, as when you create a BMenuItem, you cannot know 
which ShortcutManager to use as you don't know the window yet.

Bye,
   Axel.


Other related posts: