[haiku-development] Re: AltGr Key, key_map, and the US-International Keyboard

  • From: "Ingo Weinhold" <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 31 Mar 2012 09:19:37 +0200

John Scipione wrote:
> On Fri, Mar 30, 2012 at 6:17 PM, Rimas Kudelis <rq@xxxxxx> wrote:
[...]
> To the system Right Alt and AltGr are indistinguishable. So
> B_RIGHT_COMMAND_KEY = B_ALTGR_KEY. I believe, but am not 100%
> positive, that the hardware sends an identical keycode for AltGr as
> Right Alt. The keys cannot be distinguished from each other based on
> what the hardware reports. At least it seems that way from what I've
> read. This means that you can't map both a Right Alt and an AltGr key
> to different keys on the same keyboard since the hardware sends an
> identical keycode there is no way to differentiate the two.

Maybe I misunderstand something, but I would say you got it the wrong way 
around. The mapping is from physical key code to key role. B_RIGHT_COMMAND_KEY 
and B_ALTGR_KEY are key roles and I don't see any reason why they should be 
equal. This also means that you could very well map different keys to 
B_RIGHT_COMMAND_KEY and B_ALTGR_KEY. Or, the more relevant case, map the same 
physical key to either B_RIGHT_COMMAND_KEY or B_ALTGR_KEY depending on the 
keymap.

[...]
> >> On Fri, Mar 30, 2012 at 1:00 PM, Rimas Kudelis <rq@xxxxxx> wrote:
> > I don't really understand what shortcut combinations with Right Alt you are
> > talking about. Are there programs that differentiate between LOpt and ROpt
> > in shortcuts?
> 
> No, that's the point, there are no programs the differentiate between
> Right and Left Alt in regards to shortcuts. They all specify
> B_COMMAND_KEY which is equivalent either B_RIGHT_COMMAND_KEY or
> B_LEFT_COMMAND_KEY. And since B_RIGHT_COMMAND_KEY = B_ALTGR_KEY it
> also matches. What this means is that I have to check to see if your
> keymap is >= version 4, and decide whether or not to handle the key
> combo or not. If left alt, do the default, if right, do the AltGr
> thing. This would be easier if AltGr produced it's own keycode, but,
> like I said, I don't believe it does.

This sounds complicated and totally unnecessary to me, since 
B_RIGHT_COMMAND_KEY and B_ALTGR_KEY should not have the same value.

CU, Ingo

Other related posts: