Forking this from another discussion, because it’s veering off topic:
There is a danger here that we fork off into a near-infinite number of layout discussions, when the same principles apply to the majority of them. Most scancodes will not change, no matter the language. So maybe it’s better to concentrate on only those scancodes that will.
There are six keys, maximum that need their base-layer scancodes changed from the stock firmware to accomodate an arbitrary Latin-script language keymap.
- The number row, and all keys in line with the number row (40 keys in total) MUST use the same scancodes across all languages.
- In most languages, ANSI LeftBracket MUST go to the right of P. This is also true of Dvorak.
- In most languages, ANSI Apostrophe MUST remain to the right of ANSI Semicolon.
- ANSI Backtick is fine where it is.
- NonUsBackslashAndPipe SHOULD go on the bottom left key, beside ANSI Z. PageDown MUST therefore go elsewhere, and PageUp SHOULD go with it.
The remaining free scancodes are ANSI Backslash, Minus, Equals and RightBracket.
- The bottom-right key and Any key are available for two of those four scancodes.
- At least one scancode MUST move to the left hand (unless we want to displace Enter/Return!), and left of ANSI A SHOULD be available (see above).
- The options for the last scancode are then (realistically) limited to Prog, LED or Num.
- Mapping Prog can cause problems
- Using Num rather than LED minimizes the number of scancodes that change hands. Num can go to LED or into the Function layer.
So we can reduce our variables to the distribution of four scancodes (ANSI Backslash, Minus, Equals and RightBracket) across four physical keys (call them LEFT_OF_A
, LEFT_OF_6
, RIGHT_OF_0
, and RIGHT_OF_SLASH
). Note that all of these scancodes are used for brackets in at least one language, and therefore need to be pairable. The bracket pairs are:
- (LeftBracket, RightBracket) in English, Italian, Romanian and Spanish (es_es) QWERTY, Belgian AZERTY, Swiss QWERTZ.
- (Minus, Equals) in Dvorak and AZERTY (paired with numbers)
- (Apostrophe, Backslash) in Spanish (es_es, es_latam) QWERTY, Swiss QWERTZ
- (RightBracket, Backslash) in Brazilian QWERTY and Slovak QWERTZ
Some layouts require two paired sets of bracket keys. Slovak QWERTZ has square and curly brackets as per US QWERTY, but pairs right square bracket and backslash for left and right parentheses respectively (using AltGr). Most AZERTY variants use both of the (Minus, Equals) keys for right curly and square brackets, and the corresponding left brackets are elsewhere in the number row.
So we can define a ‘standard international’ variant where the nesting of the AZERTY and Dvorak brackets is preserved and the English QWERTY brackets are close to each other, with ANSI Backslash displaced:
#define LEFT_OF_Z Key_NonUsBackslashAndPipe
#define LEFT_OF_A Key_Backslash
#define LEFT_OF_6 Key_Minus
#define RIGHT_OF_0 Key_Equals
#define RIGHT_OF_P Key_LeftBracket
#define RIGHT_OF_SLASH Key_RightBracket
And an ‘alternative international’ variant where both of the Spanish bracket pairs remain paired and ANSI Equals is displaced:
#define LEFT_OF_Z Key_NonUsBackslashAndPipe
#define LEFT_OF_A Key_Equals
#define LEFT_OF_6 Key_Minus
#define RIGHT_OF_0 Key_RightBracket
#define RIGHT_OF_P Key_LeftBracket
#define RIGHT_OF_SLASH Key_Backslash
Is there any Latin-script language for which neither of these will work?
Japanese is going to be harder, because the Model01 doesn’t have enough keys for the Kana buttons.