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

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 5 Apr 2012 18:33:47 -0400

On Thu, Apr 5, 2012 at 4:36 PM, Adrien Destugues
<pulkomandy@xxxxxxxxxxxxx> wrote:
> Le Thu, 05 Apr 2012 19:43:40 +0200, John Scipione <jscipione@xxxxxxxxx> a
> écrit:
>
>> My point is AltGr already exists, you've got 2 of em! They are just
>> called "option" and are mapped to the Windows key, at least on
>> US-International. What's so wrong with that?
>
> I use a thinkpad, and have no R-Win key :)

I'm sorry to hear that, but luckily you have a L-Win key to compensate
for your loss.

> On windows I get this :
> Control : triggers shortcuts like copy/paste
> Alt : Triggers menu stuff
> Win : System-wide shortcuts
> AltGr : special chars

Yes, but, you are not on Windows, and you should not expect the same
behavior on Haiku.

On Haiku you get this:
Control: triggers terminal commands
Alt: Triggers shortcuts like copy/paste
Win: Special Chars
AltGr: Also triggers shortcuts like copy/paste (R-Alt)

You can neither trigger menu shortcuts nor can you trigger system wide
shortcuts via a modifier key on Haiku. But you can trigger terminal
commands via control which you can't do on Windows.

> For example, win+E opens Explorer, altGr+E types the € sign. Alt+E triggers
> some menu shortcuts, and Ctrl+E does some control char in terminal. As you
> can see, these are 4 different modifiers, with 4 different actions. There is
> no way to do this with any combination of Option/Command/Control. We just
> need an extra one to do the same.

Except in Haiku there is no equivalent to Win+E opening Explorer so
you can use Win+E to type the € sign instead. And if there were an
equivalent it would most likely be Win+T on Haiku (for Tracker)
anyway. But, given that system wide shortcuts do not as of yet exist,
but, the concept and implementation of the option key producing
shortcuts keys does exist, we stay with what exists and not cater to
the conventions of Windows.

If and when we wish to implement system wide shortcuts we simply must
use a different key combination, say Control+Opt+E or
Control+Command+E or Opt+Command+E. In fact these combinations can and
should be modifiable via a preference app so that if conflicts exist
they can be resolved by the user in on a case by case basis.

> So yes, I get only one ALT/Command key, and the Win key is mapped to Option,
> and not used anywhere besides opening deskbar menu.
> I get two control keys that are used only in terminal.
> But, the most important thing is, it matches the actual keyboard layout I
> have, and behaves as expected.

And that is the important thing, correct. I could add a B_ALTGR_KEY to
InterfaceDefs and you could put that in your keymap, but, it would
walk like an option key, talk like an option key, and quack like an
option key. In other words it would just be an option key.

> On the current French keymap, AltGr is mapped to Option, and RWin is mapped
> to Command to "compensate". This isn't annoying at all on this particular
> keyboard (which has no RWin key anyway), but on a full-size keyboard, it's
> very confusing when you try to use this RWin key and notice it doesn't work
> like LWin. And whatever way you swap them around, it just doesn't works, and
> make the "linux/windows mode" swap get things not like linux/windows at all.

Exactly, because the current French Keymap is wrong, you have baked in
a preference which should be local to your setup into the default
French keymap. It's as if I decided that I like Windows/Linux mode
better so I baked that into the default US keymap. I could do that,
but it would be quite rude.

> Yes, this AltGr keys make the keyboard assymetrical, and in Haiku with
> default settings the most useless keys (control and option) have two
> physical keys, while the most useful ones (command and altgr) have only one
> each. But that's ok for me. It's a problem to solve with keyboard
> manufacturers, actually.

I see no reason to support an AltGr key explicitly when option does
the same thing. A setting could be added to Keymap to populate the
modifier keys the way you want kind of like the current Switch
Shortcuts to Windows/Linux mode button. But the default should be to
have a symmetric layout in Haiku mode, that is from left to right:
Control, Option, Command, Space, Command, Option, Menu, Control.

John Scipione

Other related posts: