Option/Command/Alt Confusion

I’ve only seen one of these glyphs ever, and having alt gr be in a group with others makes no sense to me.

AltGr is just a variation of Alt (it’s basically a modified Right Alt). In the Windows world, their functions have diverged. MacOS has kept the original Alt (Opt) idea: a key to enter additional characters/graphics.

According to Wikipedia:
“A key labeled with some variation of “Alt Graphic” was on many computer keyboards before the Windows international layouts. On early home computers the alternate graphemes were primarily box-drawing characters.
This likely was the intended purpose of the Alt key on PC keyboards, however software quickly used this as a combination key for shortcuts, requiring a new key for producing additional characters.”

The symbols or names of the keys themselves are not that important. The unified and consistent operations of those keys are important.

alt gr and opt dont do the same thing, and they shouldnt either.

If you want to follow macos altgr should not function as a key to enter special characters at all, but as someone with an european keyboard i definetely want this functionality, making the right super key not work as a result makes no sense.

This is plain wrong. Alt and Alt Gr are two totally different keys with different functions.

Keyboards should function as they were intended to function. Alt Gr is for typing alternative characters. The Wikipedia article about Alt Gr gives a ton of examples of how the key is used in different layouts (languages) to print characters.

AltGr does not actually exist, the key is identical to right Alt, only the label on the key is different. We have no ability to discern between AltGr and right Alt. That being said, we treat right-Alt/AltGr as option in the keymaps so that it will produce special characters.

Alt Gr certainly exists on my keyboard and it is not the same as Alt. International US keyboards do not have a right Alt key, instead they have an Alt Gr. So US keyboards that uses a right Alt key is not the norm in the keyboard world, it is the exception.

Edit: Maybe it has to do with the ANSI vs ISO standard, where ANSI uses right Alt and ISO uses Alt Gr?

The key labeled AltGr on your keyboard is the same as right Alt whether you like it or not.

The right Alt key and left Alt key are identical on an ANSI keyboard. On an ISO keyboard, the right Alt key is replaced by the Alt Graph key.

https://www.makeuseof.com/ansi-vs-iso-keyboard/

I rest my case.

jscipone argues that the keycode is the same. In which case it only is specified by the keymap, which seems correct to me. If you use a keymap with altgr we should support it properly.

Actually they do on MacOS and Haiku.

MacOS considers Alt and AltGr as the Opt key. And this is very convenient for everyone who uses letters other than the English alphabet, because they need a third level of the keyboard.

Two other keys (Ctrl and Cmd) are dedicated to hotkeys.

It would be very good to leave Alt/AltGr/Opt (at least in the first role) for non-English users.

I understand from the point of view of someone who only uses English that this is a waste of a convenient key, but as I suggested above, that key could be used by such a user for hotkeys of his own choosing, or he could swap those key positions in the keyboard settings app (say Alt with Ctrl if he likes it that way or, right off the bat, a standard English two-level keyboard layout could have the Cmd and Opt keys swapped).

The macos way here is different, alt gr q for example does NOT make an @ sign, almost all these shortcuts are different.
We clearly follow windows/linux here.

opt and alt gr beeing the same is not something that should be done in haiku, it is more a workaround to be compatible with prior beos, while still supporting alt gr. We should just retire this hacc and support alt gr properly instead.

1 Like

Which character is entered depends on the layout of the keyboard (and other tricks in some OS).

I don’t think they should be followed. MacOS is much more advanced and consistent in this matter.
The duality of Alt and AltGr should be eliminated as an aberration.

I don’t want to have to relearn all keycombinations just to follow macos.

MacOS just follows the original idea of the Alt key, and that’s fine.

They can do that, I don’t see why we should not support the leyboard I already have, with an alt gr key just because macos doesn’t care for it.

Macoses keycombinazoons for special chars are different, the only similarity is that the “super” key in their case can be used for this, other than that we don’t share anything. And after Haiku has fixed this we won’t share that either.

1 Like

Regarding whether “right Alt” and “Alt Gr” are the same:
Upstream, in the physical circuitry, they are the same and the same scan code gets sent to the computer.
In the USB keyboard report that is sent (when operating in USB Boot mode), there is one byte that represents all 8 modifier keys on the keyboard:
Left shift
Right shift
Left control
Right control
Left alt
Right alt
Left windows
Right windows (no longer present on many keyboards, particularly laptops).

It is downstream in the process, in the PC software (OS), that the right alt key’s behavior gets determined.
Regardless of what’s printed on the label, the USB report is setting or clearing the “right alt” bit.

AltGr does not sit well with current Haiku key conventions. IMO it’s best to ignore it altogether, and use it as “Command”, just like Alt.

Left Opt is marked Alt and right Opt is marked as Alt Gr on an ISO Apple Extended keyboards. The right Opt acts as Alt Gr while the left Opt acts as Alt.

Then how are we supposed to be able to send emails? Copy-paste @ symbols?

Keyboards should work as intended. Simple rule that should always be followed.

1 Like