[haiku-commits] Re: r43210 - haiku/trunk/src/preferences/keymap

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 09 Nov 2011 11:02:39 +0100

Stephan Aßmus <superstippi@xxxxxx> a écrit :
> On 09.11.2011 10:25, Adrien Destugues wrote:
> >> Sure, but that's exactly how Alt-Gr is handled on any other
> > > keyboard
> >> I
> >> know. It's a special key that replaced the right Alt key. So where
> >> exactly is the problem of the French keymap?
> >> Why can't it just map the Alt-Gr and the right Win key to the same
> >> key
> >> as for example the German or US-International keyboards do?
> >
> > Currently, AltGr and left win key have the same code, but right win
> > key
> > is the same as Alt. I don't know why it was made this way, and I
> > don't
> > see why we shouldn't add an extra modifier as altgr and win
> > definitely
> > aren't the same thing ? :)
>
> As I understand it, there is a distinction in key codes between left
> and
> right Alt and left and right Win key. So if Alt-Gr physically replaces
> right Alt on a French keyboard, it would appear the keymap needs
> fixing,
> but it can be done without introducing another code, no?

The way modifiers work is a bit more complicated unfortunately. There
is a code for each individual key, and a mask for telling any of the
two key is pressed. The latter is what is used for shourtcuts, so that
both control key and both alt key work the same on a "standard" US
keyboard.
On a keyboard with AltGr we dont want AltGr to be in the same group as
Alt. Each keymap seems to have its own solution to that, the french one
swapping it with right win, the german one making it behave like LWin
and leaving RWin unmapped (which you can't notice on a thinkpad
keyboard), and the lithuanian one making RWin be a control key and
RCtrl being an CMD (like LWin). US-International uses the win key as a
way to reach the extra symbols, and has AltGr behave like Alt. (I
suggest you look at them from the keymap preflet).

So there are two solutions :
 - Either we introduce a new modifier bit for the AltGr key
 - Or we reuse the existing RAlt bit, but remove it from the Alt MASK
(and thus doesn't trigger shortcuts)

This second solution can't work, as the mask is a define and is
hardcoded in all applications now.

Other related posts: