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

  • From: Rimas Kudelis <rq@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 30 Mar 2012 20:00:20 +0300

2012.03.30 00:19, John Scipione rašė:
On Thu, Mar 29, 2012 at 3:29 PM, Rimas Kudelis<rq@xxxxxx>  wrote:
2012.03.29 21:35, John Scipione rašė:
On Thu, Mar 29, 2012 at 1:44 PM, Rimas Kudelis<rq@xxxxxx>    wrote:
2012.03.29 11:48, John Scipione rašė:

I have also updated the US-International Keymap with new keys. I moved
the current option settings to right option and filed out the right
option based on the keys produced in Mac OS X (with a little BeOS 5
thrown in).
First of all, with AltGr layer available, I don't think Option layer is
needed.
I believe that it is for some keymaps like French but François Revol
can chime in and correct me if I'm wrong.
I believe Haiku keymaps have been using the Option layer to enter
special/accented characters simply because the AltGr layer was unavailable.
For me, it's actually easier to think of your change as Option being renamed
to AltGr, and the other function (Option) being decoupled from it rather
than AltGr function being decoupled and taking with it almost everything
that Opt has been doing. So what we had in the Option layer, we now simply
move to the AltGr layer, and then the Option layer becomes empty.
Here is how you can get what you want:

Move all of the current option map settings into the altgr map and make the
option map blank. If you want AltGr to be produced by Alt instead of Win
assign right option to 0x5f and assign right command to 0x67.

Although in that case I don't see why you wouldn't switch both command and
option on the left and right sides for consistency. There may be a good reason
of which I am not aware.

I don't understand why you're replying about something I wasn't even talking about.

My point was that AltGr layer does not exist in Haiku as of yet, which is why accented characters ended up in the Opt layer. With the AltGr layer finally coming up (thanks to you), all stuff should be moved from Opt to AltGr, and that's it.


At least with the
US-International keyboard it is something that is nice to have since
you can access special keys in different ways. For instance to product
ñ you can type left-option+N followed by n using the tilde deadkey, or
you can type right-option+n to get the letter
There's a line somewhere between "this is really powerful" and "it's just
complicating things with no benefit". I tend to think that adding more
layers crosses that line, although I'm probably a bit biased because for the
languages I use, two modifiers (Shift and AltGr) are enough. I just don't
think an average user would benefit from having 6 or 8 layers in her
keyboard to enter accented characters. :) That's what dead keys are for.
I agree that the US-International keymap could get by with just an option
layer, and I would support that except for bug #2241 regarding dead keys.
https://dev.haiku-os.org/ticket/2241

I can only agree with the comments on that ticket: the way US international behaves is intentional. The only problem is if US international is the default. The default should be changed to US then, or, even better, to depend on locale in use.

The option map gets you dead keys, the AltGr map gives you the most of the
same characters without utilizing a dead key. Everybody wins, except shortcuts
that rely on option or option+shift without any other modifiers and I am
confident that that is not a big deal.

Sorry, but I don't think it was the right thing to do, for multiple reasons:
1) the way US international keymap behaves is the same way it behaves at least in Windows (I haven't checked other OS yet, but can check Linux if anyone wants me to) 2) You can only have one precomposed accented letter on each key in one layer. Your N example was quite convenient, but what about e.g. letter a? Will you put ã or à in A's AltGr layer? The letters in AltGr and AltGr-Shift layers in your screenshot are only slightly related to those in normal and Shift layers. This means the user would just have to memorize them, which I think is harder than just use the dead key occasionally. 3) If you want everyone to win, why not just move the dead keys to AltGr and AltGr-Shift layers of the appropriate keys? This wouldn't be the same US international keymap as the one in Windows, but it would allow you to type tilde and other characters as usual, while you would know that AltGr+Tilde is a dead tilde. Everybody would win, and you wouldn't need to have symbols in the Opt layer. And apps could actually rely on Option+key or Option+Shift+key even more than they can now (because now Option+key can enter a symbol, and with that change, it would not).

For the control layer perhaps it could be eliminated if it truly is
standard across all keyboard varieties and never changes. But, I can't
say that for sure and having it in the keymap doesn't really hurt
anything.
Well, it hurts a bit by uselessly complicating the keymap source file and
being a potential error vector. I don't mind it being in the binary keymap
files, but since it's not likely to be changed, I think it would make sense
to have it omitted from the source files.
It is smart to keep control and option maps in the keymaps, just in case.
Yes, they make writing keymaps harder, but once written, are more flexible.

"Just in case" is a weak rationale, IMO. You could say "it's smart to do X, just in case" about pretty much anything. I think it would be smarter to actually evaluate the needs. Has anyone from the Haiku team ever done anything unusual in the Control layer? Would you want anything unusual in the Opt layer, if you had AltGr as a separate layer?

I am trying to fix issues that have annoyed people (like me) for a long time!

Don't you have same issues with other operating systems? Like I said, I think simply moving the dead keys to 3rd and 4th levels would solve your problem.

While I have your attention, would you be interested in helping me
produce a proper Lithuanian keymap in the style of the
US-International above?
I can help you, although the current Lithuanian keymaps are the ones to look
at. I had them cleaned up recently, and all the characters it outputs in the
Opt layer actually belong to AltGr.

We could chat on IRC this weekend, my nickname is RQ. Should I plan that?
Yes definitely do. My nickname on IRC is Skipp_OSX. I'll be on #haiku this
weekend on Sunday at least, and probably late in the evening (for me,
anyway) too. So you'll be able to find me easily.

If moving the keycodes from the option map to the altgr map is the only change
then I can do it myself, but it still might be good to work through some ideas,
and I have lots of questions.

Yeah, and it seems like I have a lot of convicing to do too... :)

Rimas

Other related posts: