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

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 29 Mar 2012 04:48:49 -0400

I've added support for specifying the characters produced via a keymap
for the left and right option (Windows) keys separately. To do this I
added 4 new maps in the key_map struct in InterfaceDefs.h:
altgr_map[128], altgr_shift_map[128],  altgr_caps_map[128], and

The right option key uses the AltGr Key maps, and the left option key
uses the option maps. I didn't hardcode any key codes, you can switch
the left or right option key to another key like command or control in
the keycap app and it will still produce the same characters like
other modifier keys.

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


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

John Scipione

Other related posts: