[haiku-development] Re: Key roles vs. key label in menus

On Mon, Apr 9, 2012 at 12:50 PM, kirilla@xxxxxxxxxx <jonas@xxxxxxxxxxx>wrote:
Nice post!

What OS X does:
>
> Modifier Keys
> http://imagebin.org/207313


What Haiku does:
http://imagebin.org/206877

I took obvious inspiration from the Mac dialog when I designed the Haiku
Modifier keys window. Although since then it has diverged in several
respects.

- OS X doesn't, AFAIK, allow remapping of keys aside from a shortlist
> of  modifier keys.
>

You can download a program called Ukelele to remap the keys. Although the
program is very strange to use.


> - When remapping modifiers in OS X (e.g. swapping control and
> command, ^ and ⌘) the menus still sport the clover symbol.
>

Yes, I verified this, changing the modifier keys does not change what
appears in the menus on OS X. I guess they also are going for the "key
roles" concept. The Modifier keys dialog on Mac OS X came with Leopard to
support the then-new Mac Mini which for the first time brought the first
officially supported use of PC keyboards on the Mac.


> - The keyboard layout appears to be auto detected ("Swedish Pro")
> and is selected in the list of "Input Sources" available in one of
> the tabs of the  "Language & Text" preflet.
>
> http://imagebin.org/207314


Which is probably due to Apple making the keyboards and thus only have a
limited number to account for. Does this trick work just as well for a PC
keyboard on Mac OS X? I doubt it. We could maintain a list of USB Vendor +
Device IDs that can be detected by input server to set the keymap
accordingly.


> - There is, IIRC, an install-time dialog asking the user a few simple
> questions about the keyboard if one has connected a keyboard
> that OS X doesn't know how to auto detect.
>

Haiku would have to do the same.


> Opinions:
>
> - Haiku should try to detect locale properties of connected devices.
>

Like I said, how can that be done? Perhaps detecting USB Vendor/Device IDs
would do the trick.


> - When input  device locale (keymap) detection is not possible Haiku
> should offer sufficient configurability.


Which IMHO it does now, the user can select the keymap at install time.


> - The userfacing preferences should focus on ease of use and sane
> configurability, similar to that of OS X's Modifier Keys preflet.
>
> (Haiku's key remapping feature approaches that of a keymap editor.
> Should it be broken out and perfected as an editor instead?)
>
> - The first priority of Haiku should be to mimic overall keyboard
> conventions. In other words: respect common user expectations.
> Common, cross-platform conventions. Stuff people expect.
>
> If it is common for users of a certain locale to expect the pressing of
> Alt-Gr + S to result in a german ß, it should happen also in Haiku.
> To deviate from this is to shoot oneself in the foot.
>

I begrudgingly accept this to be true.


> - Seconday priority would be to mimic the present keyboard(s)
> physical appearance, set of keys, layout, keycaps.
>
> For menu option shortcut legends it should be possible (in spite
> of key remapping, I think) to offer two legend sets:
>
> - PC (ctrl, alt, cmd, ... ?)
> - Mac (^ ⌥ ⌘)
>

This is not possible. We must choose 1 set. What if you had a PC keyboard
and a Mac keyboard plugged in to your computer at the same time? Perhaps we
could come up with set of rules but it would be a lot easier just to make a
decision one way or the other.


> If that isn't doable for some reason, one could IMO do a lot worse than
> going with the Mac symbols, as key roles. (Ideally mapped by default
> to exactly those physical keys when using a Mac keyboard.)
>

I like the idea of using the Mac symbols in the menu with COMBINING
ENCLOSING KEYCAP like this:  ⇧⃣  showing that they are modifier keys. This
also cleanly solves the ^ vs. control modifier key issue.


> There may be need for a Mac-like shortcut legend for the Alt-Gr key,
> since it's not unthinkable to have apps use it as shortcut modifier
> in locales where Alt-Gr is a common keymap option. (Probably not
> a good idea, but still.)


The AltGr key would probably show up in the menus as the option key.


> Gripes:
>
> - Mac and PC keyboards: 2 dissimilar keymaps
> - Mac, Windows and Haiku/PC keyboard: 3 dissimilar keymaps
> - Mac, Windows, Haiku/PC keyb, Haiku/Mac keyb: 4 dissimilar keymaps
>
> I use a Mac keyboard with my Haiku PC, to standardize on some
> resemblance of order, but it breaks down with Haiku, and switching
> between 4 dissimilar keymaps is horribly unfriendly.)
>

One solution to the ever inflating keymap problem would be to break
modifier keys out of keymaps and restrict them to just the non-modifier
keys. This would also be needed for a real keymap switcher anyway. Although
you'll still need to include Mac keymaps for the other keys, except perhaps
for US and US-International.


> (I think Haiku's Mac keymaps are broken. Pressing the clover key shows
> up in Haikus Keymap preferences as alt being pressed. There are also
> issues with <> and §°. I should file a bug report.)
>

Select an appropriate Apple Aluminum keyboard layout and you'll see that
Keymap is doing the right thing as far as pushing the clover key goes. As
far as the <> and §° characters goes, if there are errors in your keymap
you should file a bug report. Note that the Mac keymaps should be a bit
different from their PC counterparts for some keys.

I think Haiku applies PC key locations to Mac keyboards, where a lot of
> characters reside in other places, making it a larger issue than merely
> that of swapping the modifier keys. It's similar, mentally, to finding
> myself
> with a US keymap on my Swedish keyboard, but more severe.
>
> I don't care so much about the choice of bitmaps, symbols or text in the
> shortcut legends on the menu options, but I do care very much about
> the keyboards working reasonably uniformly, regardless of what system
> I'm interfacing, being true to the keyboards physical appearance and
> working reasonably the same across different operating systems.
>
> (I hindsight I think Be was wrong to go for Alt as the command key on PC
> keyboards. They failed to understand the significance of Alt-Gr in the
> european markets, and never got around to fixing it properly.)
>

It seems a bit odd that a company with a Frenchman for a CEO would have
failed to understand the significance of AltGr. It seems more likely that
they emulated the Mac key layout when moving to a PC keyboard. This seems
pretty reasonable to me.

John Scipione

Other related posts: