Alt, AltGr, and Mac/PC mode

Continuing the discussion from Initial Dvorak Layout:

Yep. Not saying the current is good, but I don’t see an easy way to have both. I’m forking this discussion off, as it is not tied to Dvorak, and affects all other layouts too.

One way I saw it done, is to have a way to set the keyboard mode: Mac or PC. In Mac mode, it would have Cmd/AltGr, while it PC mode, it would have Alt/AltGr. With QMK, you can set it by pressing a magic combo while plugging the keyboard in, or you can compile the firmware with a special flag set.

In case of the Model 01, it could try detecting the host system, and set up a default mode based on that. Then, we can figure out a way to tell the keyboard to set its mode to either of these, and save it in EEPROM to remember.

I don’t see a way around having both LAlt and RAlt (AltGr), in any case you want command on Win and to a lesser degree Linux as well as it’s the “Windows” key and that’s required for a lot of shortcuts.

The original intent of AltGr, back in the day, was to let you type box drawing characters. Over time, it’s been adopted to let typists get at a number of other symbols and characters. On MacOS, “Option” (left or right) is often used for something similar.

We must have a way of letting people input text.

We don’t necessarily need to provide a literal AltGr key. In a lot of ways, our function keys are similar to AltGr. It’d be possible to put symbols on the Function layer. Or to make the left and right function keys do different things.

Hi Jesse,

I very much doubt that we could add all the symbols that get entered with AltGr, there are literally thousands of them depending on the layout used (think international layouts) but perhaps the correct solution is to have Function + Alt send the ScanCode for AltGR, same could be done for the Menu key (Right Win) and possibly Ctrl.

The downside of that is you might get some very contorted key combinations.

Oh, I certainly wasn’t thinking of doing it all in a single layout. so much as building hardware layouts for various languages.

Because the Model 01’s key layout is different enough than a traditional keyboard, I don’t really expect host-side software mapping from 10[1-5] key keyboards to actually result in good layouts. :confused:

If we do want a dedicated Alt-Gr, one possible key is the butterfly key.

I think the alternative to doing multiple layouts, one for each language is to try for a unified layout similar to what I did with the Gelatin layout I posted in the Colemak section. The same principals of using a combination of dead keys with AltGr modifier and custom layouts can get you all the languages that use a Latin character set in one layout with QWERTY, DVORAK, etc.

When it comes to languages using Cyrillic, Greek or Oriental character sets I’m not qualified to comment but probably they would need to remain separate.

While I like the idea of Fn+Alt being AltGr, we’d want to be sure that keys used with AltGr aren’t only availabel in the Fn layer, since then there’d be a conflict, right?

That’s correct, if you look in the Gelatin layout posted in Colemak you can see the AltGr mods and the layers that I used to avoid conflicts, essentially almost all the combos involve characters, numbers and symbols.

@kajsa.anderson If we needed to, we could treat Fn+Alt as a different layer than straight Fn. I’m not sure it’d be a good idea, but it’s possible :wink:

It’s not that different. You can make arbitrary pc105 mappings work for all keys except us-qwerty backslash (see the dvorak thread).

Would that use the right-alt scancode by default, or would you have to set that as an option?

Alternatively, we could use the current Alt key proposal as right-Alt (=AltGr) and have vanilla left-Alt as a Butterfly option for those whose OS keymap needs both.

As a non-AltGr user, I don’t really know what’s “correct”

I’m a compose key user rather than an altgr one, but I know that a lot of keymaps require altgr to be chorded with shift (e.g. for uppercase accented characters) and this is horribly awkward on a vanilla pc105.

I would require an an easy way to get the functionality of Alt-Gr.
I use an English layout (Colemak), but since I live in Germany I need easy access to at least (ß,ä,ë,ö,£,€). Oh, and I might move to France, which would need even more (œ, à, â, ç, è, é, ï, ô).
Since I imagine moving between Windows, macOS and Linux, an Alt-Gr key (or equivalent) would seem to be the easiest way for me to enter these characters (and more) consistently.

As per Mark’s post in Colemak, would it not be better to have both left and right alt, control and shift on the thumbs? Super could then be on butterfly. We could have a mac/pc hotkey to swap these around if necessary.


With the “how many modifiers to put on the keyboard?” question aside, I’m working on a plugin that makes it easier to switch between Mac and PC. Since the last mac I used was MacOS8, and I only used it until I could install Linux, I have absolutely no clue what keys are important for a Mac, and how those should translate to PC.

So far, the plugin has a key that acts as on a Mac, and as LAlt on PC. Is that something desirable, useful, etc? Are there other keys that could use a similar translation?

Input from any Mac users would be much appreciated!

Sadly none of the media/brightness/power or other keys on the top row are available (I don’t think they use scan codes) without a 3rd party app like Karabiner, but the rest of these mods are available:

Important mods on left hand:
Modifier Change
Keys: fn
Key Code: 65535 / 0xffff
Modifiers: 8388864 / 0x800100 ⓘ

Modifier Change
Keys: ⌃
Key Code: 65535 / 0xffff
Modifiers: 262401 / 0x40101 ⓘ

Modifier Change
Keys: ⌥
Key Code: 65535 / 0xffff
Modifiers: 524576 / 0x80120 ⓘ

Modifier Change
Keys: ⌘
Key Code: 65535 / 0xffff
Modifiers: 1048840 / 0x100108 ⓘ

Modifier Change
Keys: ⇧
Key Code: 65535 / 0xffff
Modifiers: 131330 / 0x20102 ⓘ

Important mods on right hand:
Modifier Change
Keys: ⌘
Key Code: 65535 / 0xffff
Modifiers: 1048848 / 0x100110 ⓘ

Modifier Change
Keys: ⌥
Key Code: 65535 / 0xffff
Modifiers: 524608 / 0x80140 ⓘ

Modifier Change
Keys: ⇧
Key Code: 65535 / 0xffff
Modifiers: 131332 / 0x20104 ⓘ

1 Like

Don’t swap command and alt. Alt in macos is by default altgr.

If you’re going to swap anything, swap command and ctrl (since command is used on macos for the common shortcuts such as cut, copy, paste, undo, quit). But beware, because this completely messes up the command line, where ctrl is still ctrl. There’s no magic bullet I’m afraid.

Mhm. I see. I’ll swap Ctrl/Command then. For the commandline, a small agent on the host that can talk to the keyboard, would be able to tell the keyboard when to switch back and forth between swapping and not swapping…

Thanks for the input!

Okay, re-reading your comment, this confuses me a bit. The way I imagined this plugin would work, is that you’d have an AltGr key somewhere, which the plugin would not touch. Then you’d have another key that would be on Mac, and Left Alt on PC. So on Mac, you’d have both and AltGr, and on PC, Alt and AltGr.

Or should the AltGr switch to Alt on Mac?

Apologies for the dumb questions, I’m really clueless when it comes to macs.

At a scan code level there is no such thing as altgr, just left alt and right alt. All keyboards (except some reduced ones such as laptops) have these.

At a key map level, right alt sometimes gets mapped to altgr, which acts as a distinct modifier. Vanilla alt is normally used for hot keys and altgr for glyphs.

On macs, there is no altgr. But the default keymaps are such that alt+printable generates a similar event to what altgr+printable does on pc, ie alternative glyphs. The sort of hotkey events that vanilla alt is used for on pc are done by other combinations such as command+alt+printable (but these are application dependent).

1 Like