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

  • From: Rimas Kudelis <rq@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 29 Mar 2012 20:44:38 +0300

Hi John,

2012.03.29 11:48, John Scipione rašė:

<Some really low level info skipped... >

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). Below is a screenshot of the result with left option,
left-option-shift, right-option, and right-option-shift held down
respectively:

http://imagebin.org/205663

I wish to continue this treatment for each of the keymaps that needs
an AltGr key, French, Lithuanian, etc.

The only problem is, is adding more maps to the key_map struct going
to break backwards compatibility? Do we care?

I think you fixed http://dev.haiku-os.org/ticket/6442, by the way. ;)

First of all, with AltGr layer available, I don't think Option layer is needed. 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.

I don't know about the internals of Haiku, but I like the way these keys are handled in HTML and JavaScript: IIRC, their states (pressed/not pressed) are like flags of a keypress event.

I upped the version up the US-International keymap to 4 and also to
make sure that existing version 3 keymaps continue to work.

You can see what the US-International Keymap looks like after my
changes here: http://pastebin.com/NPNYQmhA

I also realize that AltGr is usually right Alt not right option, and
not right option, but, I figured making it 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 definately 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.


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

Regards,
Rimas

Other related posts: