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

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 29 Mar 2012 14:35:07 -0400

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. 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 directly.

> Subsequently, I don't think Option and Control layers should belong
> to the keymap at all. At least the Control layer seems to output low-level
> stuff. Is there any reason why it should be localizable and not hardcoded
> (or at least not autogenerated)? Same goes for the Opt-layer, if it were to
> be used for application shortcuts as you suggest below.
> Making the Opt layer unavailable in the keymap definition source file and
> replacing it with an AltGr layer would allow to retain the compatibility of
> keymap source files. Making Control layer unavailable too would render
> current definitions incompatible, but would also make the new format
> cleaner.

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.

As for as the Opt-layer, generally shortcuts use Command (Alt by
default), very few utilize Option alone. But, I could remove mappings
of less-used characters in the Option map in order to facilitate using
option for shortcuts combos. My thinking was, Option (Windows by
default) is the special character key. If it is used as a shortcut key
generally it will be combined with Command so I am free to use option
alone (or combined with shift) for special characters. There may be
some exceptions to this, if so, I'll prune the option map.

>> I also realize that AltGr is usually right Alt not right option,
>> but, I figured assigning it to right option would cause
>> less conflicts and would free up the right alt key for use with
>> application shortcuts instead. Maybe a better name than AltGr could be
>> used.
>
> It definitely does. Here's a spark for a flamewar: how about renaming those
> keys to Alt and AltGr? PC's, which are the primary target of Haiku, don't
> have Opt keys on their usual keyboards anyway, and Opt->Alt rename would not
> hurt compatibility as it would be just a cosmetic change. Technically,
> L3Shift would probably be more appropriate for AltGr, but the "Computers
> don't have it" argument could be applied here as well. AltGr is just a
> commonly known name of that key.

Unfortunately the Alt and AltGr keys are assigned to Command, not
Option so AltGr might even be actively confusing. I like the idea of
calling the map shift-level-3. That is unambiguous.

> By the way, a keymap file attached to http://dev.haiku-os.org/ticket/6546
> crashes the keymap utility. I've debugged it and it appears that some of my
> definitions (e.g.
> http://dev.haiku-os.org/attachment/ticket/6546/Lithuanian.keymap#L209) are
> simply too long. Is there any chance of you looking and fixing that problem
> too, please?..

I looked at the Lithuanian.keymap file you posted and lines 80-90 do
not end in a space. I was just messing with the /bin/keymap app (to
make it read and produce version 4 keymaps) and I am almost sure that
it requires there to be a space at the end of each line.

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 have the information from
http://en.wikipedia.org/wiki/AltGr_key to go on, but, someone with
real knowledge of using a Lithuanian keyboard, knowing what characters
are useful and not, would be extremely useful.

John Scipione

Other related posts: