[haiku-bugs] Re: [Haiku] #7967: Update menu modifier images to more accurately reflect the corresponding key that appears on the keyboard

  • From: "jscipione" <trac@xxxxxxxxxxxx>
  • Date: Wed, 07 Sep 2011 02:13:33 -0000

#7967: Update menu modifier images to more accurately reflect the corresponding
key that appears on the keyboard
------------------------------+----------------------------
   Reporter:  jscipione       |      Owner:  stippi
       Type:  enhancement     |     Status:  new
   Priority:  normal          |  Milestone:  R1
  Component:  User Interface  |    Version:  R1/Development
 Resolution:                  |   Keywords:
 Blocked By:                  |   Blocking:
Has a Patch:  0               |   Platform:  All
------------------------------+----------------------------

Comment (by jscipione):

 Replying to [comment:13 bonefish]:
 > Physical key codes are mapped to "virtual" key codes or, as I would name
 them in Haiku's case, key roles. E.g. your BView::KeyDown() gets a
 `B_COMMAND_KEY` regardless of whether the key you pressed on your keyboard
 is actually labeled "Command" or not.

 Well, other than making a different keymap for B_OPTION_KEY on Mac
 keyboards vs. PC keyboard that is exactly what I am doing. I look at the
 virtual keycode and return a bitmap corresponding to it. However, I don't
 see how this allows me to localize the bitmap unless I also know the
 locale. Maybe there is a function in the Locale kit I could call to get
 that information? Although I suppose the correspondence is not 1:1.

 >
 > Unless we want to move to an explicit two-step mapping -- i.e. physical
 key code -> virtual key code -> key role (*) -- it is not helpful (and
 even problematic in case of multiple-to-one mapping) to display the actual
 legends in KeyMap and use them in menus.

 It might be helpful to have a level where you specify your Locale and
 Keyboard type, and then build virtual codes on top of that. German -> Mac
 -> B_COMMAND_KEY vs. German -> PC -> B_COMMAND_KEY. This would eliminate
 one level of keymap indirection. Right now there are a bunch of (Mac)
 versions of the keymaps defined in the same locale that could be
 eliminated. I don't know, maybe that is overkill.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7967#comment:14>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: