]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[console] Include mappings for AltGr-Shift-<key>
authorMichael Brown <mcb30@ipxe.org>
Wed, 16 Feb 2022 15:19:35 +0000 (15:19 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 16 Feb 2022 15:31:47 +0000 (15:31 +0000)
The BIOS console's interpretation of LShift+RShift as equivalent to
AltGr requires the shifted ASCII characters to be present in the AltGr
mapping table, to allow AltGr-Shift-<key> to be interpreted in the
same way as AltGr-<key>.

For keyboard layouts that have different ASCII characters for
AltGr-<key> and AltGr-Shift-<key>, this will potentially leave the
character for AltGr-<key> inaccessible via the BIOS console if the
BIOS requires the use of the LShift+RShift workaround.  This
theoretically affects the numeric keys in the Lithuanian ("lt")
keyboard layout (where the numerals are accessed via AltGr-<key> and
punctuation characters via AltGr-Shift-<key>), but the simple
workaround for that keyboard layout is to avoid using AltGr and Shift
entirely since the unmodified numeric keys are not remapped anyway.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
20 files changed:
src/hci/keymap/keymap_al.c
src/hci/keymap/keymap_cf.c
src/hci/keymap/keymap_cz.c
src/hci/keymap/keymap_de.c
src/hci/keymap/keymap_dk.c
src/hci/keymap/keymap_es.c
src/hci/keymap/keymap_fi.c
src/hci/keymap/keymap_fr.c
src/hci/keymap/keymap_hu.c
src/hci/keymap/keymap_il.c
src/hci/keymap/keymap_it.c
src/hci/keymap/keymap_lt.c
src/hci/keymap/keymap_mt.c
src/hci/keymap/keymap_nl.c
src/hci/keymap/keymap_no-latin1.c
src/hci/keymap/keymap_no.c
src/hci/keymap/keymap_pt.c
src/hci/keymap/keymap_se.c
src/hci/keymap/keymap_sg.c
src/util/genkeymap.py

index 6e14395a539f57c0f9cc5dc05359d3d6e68980b6..ad4792b9b0f7145631991cc99c18b378d320c055 100644 (file)
@@ -39,6 +39,7 @@ static struct keymap_key al_basic[] = {
 static struct keymap_key al_altgr[] = {
        { 0x21, 0x7e }, /* '!' => '~' */
        { 0x26, 0x60 }, /* '&' => '`' */
+       { 0x29, 0x7e }, /* ')' => '~' */
        { 0x30, 0x7e }, /* '0' => '~' */
        { 0x31, 0x7e }, /* '1' => '~' */
        { 0x34, 0x7e }, /* '4' => '~' */
index 55bbfc1a469e6f4a3e0fcbb0817e9e081965cb93..7ecfc44485764631d630e3050ed32f2aef36c41d 100644 (file)
@@ -30,11 +30,17 @@ static struct keymap_key cf_basic[] = {
 
 /** "cf" AltGr remapping */
 static struct keymap_key cf_altgr[] = {
+       { 0x22, 0x7b }, /* '"' => '{' */
        { 0x27, 0x7b }, /* '\'' => '{' */
        { 0x32, 0x40 }, /* '2' => '@' */
+       { 0x3a, 0x7e }, /* ':' => '~' */
        { 0x3b, 0x7e }, /* ';' => '~' */
        { 0x5c, 0x7d }, /* '\\' => '}' */
        { 0x60, 0x5c }, /* '`' => '\\' */
+       { 0x7b, 0x5b }, /* '{' => '[' */
+       { 0x7c, 0x7d }, /* '|' => '}' */
+       { 0x7d, 0x5d }, /* '}' => ']' */
+       { 0x7e, 0x5c }, /* '~' => '\\' */
        { 0, 0 }
 };
 
index 08e9638e16a65f57b8433ee28b8e599a3e29638d..dd793a8d0edf0ba5080fcb540636ccda4a2e8144 100644 (file)
@@ -52,6 +52,7 @@ static struct keymap_key cz_basic[] = {
 static struct keymap_key cz_altgr[] = {
        { 0x21, 0x7e }, /* '!' => '~' */
        { 0x24, 0x7e }, /* '$' => '~' */
+       { 0x28, 0x7b }, /* '(' => '{' */
        { 0x29, 0x7e }, /* ')' => '~' */
        { 0x2c, 0x3c }, /* ',' => '<' */
        { 0x2e, 0x3e }, /* '.' => '>' */
@@ -65,7 +66,13 @@ static struct keymap_key cz_altgr[] = {
        { 0x39, 0x7b }, /* '9' => '{' */
        { 0x3a, 0x7e }, /* ':' => '~' */
        { 0x3b, 0x24 }, /* ';' => '$' */
+       { 0x41, 0x7e }, /* 'A' => '~' */
+       { 0x42, 0x7b }, /* 'B' => '{' */
+       { 0x43, 0x26 }, /* 'C' => '&' */
+       { 0x46, 0x5b }, /* 'F' => '[' */
+       { 0x47, 0x5d }, /* 'G' => ']' */
        { 0x4b, 0x26 }, /* 'K' => '&' */
+       { 0x56, 0x40 }, /* 'V' => '@' */
        { 0x58, 0x3e }, /* 'X' => '>' */
        { 0x5a, 0x3c }, /* 'Z' => '<' */
        { 0x61, 0x7e }, /* 'a' => '~' */
@@ -76,6 +83,8 @@ static struct keymap_key cz_altgr[] = {
        { 0x6e, 0x7d }, /* 'n' => '}' */
        { 0x76, 0x40 }, /* 'v' => '@' */
        { 0x78, 0x23 }, /* 'x' => '#' */
+       { 0x7b, 0x5b }, /* '{' => '[' */
+       { 0x7d, 0x5d }, /* '}' => ']' */
        { 0, 0 }
 };
 
index ca5e4a9a97c355c6d4b664f54385dd19c7bbec5b..fb1136dc7c4ee5fd905db3ca6285ddb2dc244df4 100644 (file)
@@ -45,15 +45,23 @@ static struct keymap_key de_basic[] = {
 
 /** "de" AltGr remapping */
 static struct keymap_key de_altgr[] = {
+       { 0x26, 0x7b }, /* '&' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x2d, 0x5c }, /* '-' => '\\' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x37, 0x7b }, /* '7' => '{' */
        { 0x38, 0x5b }, /* '8' => '[' */
        { 0x39, 0x5d }, /* '9' => ']' */
+       { 0x3a, 0x7e }, /* ':' => '~' */
        { 0x3b, 0x7e }, /* ';' => '~' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x5d, 0x7e }, /* ']' => '~' */
+       { 0x5f, 0x5c }, /* '_' => '\\' */
        { 0x71, 0x40 }, /* 'q' => '@' */
        { 0x7c, 0x7e }, /* '|' => '~' */
+       { 0x7d, 0x7e }, /* '}' => '~' */
        { 0xdc, 0x7c }, /* Pseudo-'\\' => '|' */
        { 0, 0 }
 };
index 5b229024af044bdc71d433318a9a15f49a0c4178..45cdeb25d1be0b88ca2e46cd0cad3500e33ee1d2 100644 (file)
@@ -37,6 +37,11 @@ static struct keymap_key dk_basic[] = {
 
 /** "dk" AltGr remapping */
 static struct keymap_key dk_altgr[] = {
+       { 0x26, 0x7b }, /* '&' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
+       { 0x2b, 0x7c }, /* '+' => '|' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x32, 0x40 }, /* '2' => '@' */
        { 0x34, 0x24 }, /* '4' => '$' */
@@ -45,9 +50,12 @@ static struct keymap_key dk_altgr[] = {
        { 0x39, 0x5d }, /* '9' => ']' */
        { 0x3a, 0x7e }, /* ':' => '~' */
        { 0x3d, 0x7c }, /* '=' => '|' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x5c, 0x7e }, /* '\\' => '~' */
        { 0x5d, 0x7e }, /* ']' => '~' */
        { 0x71, 0x40 }, /* 'q' => '@' */
+       { 0x7c, 0x7e }, /* '|' => '~' */
+       { 0xfc, 0x5c }, /* Pseudo-'|' => '\\' */
        { 0, 0 }
 };
 
index 93d87f2a01be6db05bc0061aa5be0ced8b610318..c1c55b3487256b065eb201d9491a65914cbe8410 100644 (file)
@@ -37,8 +37,13 @@ static struct keymap_key es_basic[] = {
 
 /** "es" AltGr remapping */
 static struct keymap_key es_altgr[] = {
+       { 0x21, 0x7c }, /* '!' => '|' */
        { 0x22, 0x7b }, /* '"' => '{' */
+       { 0x26, 0x7b }, /* '&' => '{' */
        { 0x27, 0x7b }, /* '\'' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x2b, 0x7e }, /* '+' => '~' */
        { 0x2d, 0x5c }, /* '-' => '\\' */
        { 0x30, 0x7d }, /* '0' => '}' */
@@ -52,9 +57,12 @@ static struct keymap_key es_altgr[] = {
        { 0x3a, 0x7e }, /* ':' => '~' */
        { 0x3b, 0x7e }, /* ';' => '~' */
        { 0x3d, 0x7e }, /* '=' => '~' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x5c, 0x7d }, /* '\\' => '}' */
+       { 0x5f, 0x5c }, /* '_' => '\\' */
        { 0x60, 0x5c }, /* '`' => '\\' */
        { 0x71, 0x40 }, /* 'q' => '@' */
+       { 0x7b, 0x5b }, /* '{' => '[' */
        { 0x7c, 0x7e }, /* '|' => '~' */
        { 0x7e, 0x5c }, /* '~' => '\\' */
        { 0xdc, 0x7c }, /* Pseudo-'\\' => '|' */
index ac69813e8ac8d69d014a0b6efaadbea0dd9d4e38..8bcd0c393dc402dd45c9f83effa662a417970c3b 100644 (file)
@@ -35,6 +35,8 @@ static struct keymap_key fi_basic[] = {
 
 /** "fi" AltGr remapping */
 static struct keymap_key fi_altgr[] = {
+       { 0x26, 0x7b }, /* '&' => '{' */
+       { 0x29, 0x7d }, /* ')' => '}' */
        { 0x2d, 0x5c }, /* '-' => '\\' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x32, 0x40 }, /* '2' => '@' */
@@ -44,6 +46,8 @@ static struct keymap_key fi_altgr[] = {
        { 0x39, 0x5d }, /* '9' => ']' */
        { 0x49, 0x7c }, /* 'I' => '|' */
        { 0x5d, 0x7e }, /* ']' => '~' */
+       { 0x5f, 0x5c }, /* '_' => '\\' */
+       { 0x7d, 0x7e }, /* '}' => '~' */
        { 0xdc, 0x7c }, /* Pseudo-'\\' => '|' */
        { 0, 0 }
 };
index ad797f876a90a1ec653c4df31676832645471751..23a0837fb352750ad43c2e88f7902ae000b7a869 100644 (file)
@@ -65,6 +65,11 @@ static struct keymap_key fr_basic[] = {
 
 /** "fr" AltGr remapping */
 static struct keymap_key fr_altgr[] = {
+       { 0x25, 0x5b }, /* '%' => '[' */
+       { 0x26, 0x60 }, /* '&' => '`' */
+       { 0x29, 0x40 }, /* ')' => '@' */
+       { 0x2a, 0x5c }, /* '*' => '\\' */
+       { 0x2b, 0x7d }, /* '+' => '}' */
        { 0x2d, 0x5d }, /* '-' => ']' */
        { 0x30, 0x40 }, /* '0' => '@' */
        { 0x33, 0x23 }, /* '3' => '#' */
@@ -74,7 +79,10 @@ static struct keymap_key fr_altgr[] = {
        { 0x37, 0x60 }, /* '7' => '`' */
        { 0x38, 0x5c }, /* '8' => '\\' */
        { 0x3d, 0x7d }, /* '=' => '}' */
+       { 0x41, 0x40 }, /* 'A' => '@' */
        { 0x5c, 0x60 }, /* '\\' => '`' */
+       { 0x5e, 0x7c }, /* '^' => '|' */
+       { 0x5f, 0x5d }, /* '_' => ']' */
        { 0x61, 0x40 }, /* 'a' => '@' */
        { 0xdc, 0x7c }, /* Pseudo-'\\' => '|' */
        { 0, 0 }
index d64baaebf5b1245ea674ff94715119af755c8f97..77167140866d3ea8d44363c51deb163bdec08eca 100644 (file)
@@ -39,7 +39,9 @@ static struct keymap_key hu_basic[] = {
 static struct keymap_key hu_altgr[] = {
        { 0x21, 0x7e }, /* '!' => '~' */
        { 0x23, 0x5e }, /* '#' => '^' */
+       { 0x24, 0x7e }, /* '$' => '~' */
        { 0x26, 0x60 }, /* '&' => '`' */
+       { 0x29, 0x7e }, /* ')' => '~' */
        { 0x2c, 0x3b }, /* ',' => ';' */
        { 0x2e, 0x3e }, /* '.' => '>' */
        { 0x2f, 0x2a }, /* '/' => '*' */
@@ -49,8 +51,19 @@ static struct keymap_key hu_altgr[] = {
        { 0x33, 0x5e }, /* '3' => '^' */
        { 0x34, 0x7e }, /* '4' => '~' */
        { 0x37, 0x60 }, /* '7' => '`' */
+       { 0x3a, 0x24 }, /* ':' => '$' */
        { 0x3b, 0x24 }, /* ';' => '$' */
+       { 0x3c, 0x3b }, /* '<' => ';' */
+       { 0x40, 0x5e }, /* '@' => '^' */
+       { 0x42, 0x7b }, /* 'B' => '{' */
+       { 0x43, 0x26 }, /* 'C' => '&' */
+       { 0x46, 0x5b }, /* 'F' => '[' */
+       { 0x47, 0x5d }, /* 'G' => ']' */
        { 0x4b, 0x26 }, /* 'K' => '&' */
+       { 0x4d, 0x3c }, /* 'M' => '<' */
+       { 0x51, 0x5c }, /* 'Q' => '\\' */
+       { 0x56, 0x40 }, /* 'V' => '@' */
+       { 0x57, 0x7c }, /* 'W' => '|' */
        { 0x58, 0x3e }, /* 'X' => '>' */
        { 0x5a, 0x3c }, /* 'Z' => '<' */
        { 0x62, 0x7b }, /* 'b' => '{' */
index 95e33a0bd30cee0740266d08fc33620c204ea9b5..b11e7ce7123645505111d5a9e9b4c295916055ca 100644 (file)
@@ -31,7 +31,12 @@ static struct keymap_key il_basic[] = {
 
 /** "il" AltGr remapping */
 static struct keymap_key il_altgr[] = {
+       { 0x22, 0x27 }, /* '"' => '\'' */
+       { 0x3f, 0x2f }, /* '?' => '/' */
        { 0x5c, 0x60 }, /* '\\' => '`' */
+       { 0x71, 0x2f }, /* 'q' => '/' */
+       { 0x77, 0x27 }, /* 'w' => '\'' */
+       { 0x7c, 0x60 }, /* '|' => '`' */
        { 0, 0 }
 };
 
index 2511bb7910bf65176fd3c30f6084d0b4dbc57d96..bb14ae1bda75d9d0013320f55a64ef3e7c7d2dcd 100644 (file)
@@ -37,17 +37,25 @@ static struct keymap_key it_basic[] = {
 
 /** "it" AltGr remapping */
 static struct keymap_key it_altgr[] = {
+       { 0x22, 0x23 }, /* '"' => '#' */
        { 0x23, 0x7e }, /* '#' => '~' */
+       { 0x26, 0x7b }, /* '&' => '{' */
        { 0x27, 0x23 }, /* '\'' => '#' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x2d, 0x60 }, /* '-' => '`' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x37, 0x7b }, /* '7' => '{' */
        { 0x38, 0x5b }, /* '8' => '[' */
        { 0x39, 0x5d }, /* '9' => ']' */
+       { 0x3a, 0x40 }, /* ':' => '@' */
        { 0x3b, 0x40 }, /* ';' => '@' */
        { 0x3d, 0x7e }, /* '=' => '~' */
        { 0x40, 0x7e }, /* '@' => '~' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x5c, 0x60 }, /* '\\' => '`' */
+       { 0x5f, 0x60 }, /* '_' => '`' */
        { 0x71, 0x40 }, /* 'q' => '@' */
        { 0x7c, 0x7e }, /* '|' => '~' */
        { 0, 0 }
index a237b1d6200ede98496d0629c2a3be7b397e1286..f8e60a5c5a40319ae7359dd90d1f070c86c2e2ae 100644 (file)
@@ -20,6 +20,7 @@ static struct keymap_key lt_altgr[] = {
        { 0x22, 0x5e }, /* '"' => '^' */
        { 0x27, 0x5e }, /* '\'' => '^' */
        { 0x4b, 0x26 }, /* 'K' => '&' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x71, 0x40 }, /* 'q' => '@' */
        { 0, 0 }
 };
index a95c5b4e84b22de29d51b46b015c71e839c34d84..0997bfe93265c71455337c039516cfa59e5040d6 100644 (file)
@@ -22,11 +22,16 @@ static struct keymap_key mt_basic[] = {
 
 /** "mt" AltGr remapping */
 static struct keymap_key mt_altgr[] = {
+       { 0x26, 0x7b }, /* '&' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x37, 0x7b }, /* '7' => '{' */
        { 0x38, 0x5b }, /* '8' => '[' */
        { 0x39, 0x5d }, /* '9' => ']' */
        { 0x5c, 0x60 }, /* '\\' => '`' */
+       { 0x7e, 0x60 }, /* '~' => '`' */
        { 0, 0 }
 };
 
index 8038d4d370bf137bc00a444acc5c820bfaec9b32..97c7e8b5d820a2147e9beffd9f6af28edd6e9414 100644 (file)
@@ -46,6 +46,7 @@ static struct keymap_key nl_altgr[] = {
        { 0x2d, 0x5c }, /* '-' => '\\' */
        { 0x38, 0x7b }, /* '8' => '{' */
        { 0x39, 0x7d }, /* '9' => '}' */
+       { 0x5f, 0x5c }, /* '_' => '\\' */
        { 0, 0 }
 };
 
index 1f4cc38d336b1bf35677863313432757f12a4e00..80df84889d5bcd935e1ae25cc3afa1ae6c487224 100644 (file)
@@ -40,7 +40,11 @@ static struct keymap_key no_latin1_basic[] = {
 /** "no-latin1" AltGr remapping */
 static struct keymap_key no_latin1_altgr[] = {
        { 0x22, 0x5b }, /* '"' => '[' */
+       { 0x26, 0x7b }, /* '&' => '{' */
        { 0x27, 0x7b }, /* '\'' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x32, 0x40 }, /* '2' => '@' */
        { 0x37, 0x7b }, /* '7' => '{' */
index 239e3aea5bd92e96532955cd76ca80207d55c36a..0a624c3ab76d62213108ca35dcb7032509a85171 100644 (file)
@@ -39,6 +39,10 @@ static struct keymap_key no_basic[] = {
 
 /** "no" AltGr remapping */
 static struct keymap_key no_altgr[] = {
+       { 0x26, 0x7b }, /* '&' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x32, 0x40 }, /* '2' => '@' */
        { 0x34, 0x24 }, /* '4' => '$' */
@@ -46,9 +50,11 @@ static struct keymap_key no_altgr[] = {
        { 0x38, 0x5b }, /* '8' => '[' */
        { 0x39, 0x5d }, /* '9' => ']' */
        { 0x3a, 0x7e }, /* ':' => '~' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x5c, 0x7e }, /* '\\' => '~' */
        { 0x5d, 0x7e }, /* ']' => '~' */
        { 0x71, 0x40 }, /* 'q' => '@' */
+       { 0x7c, 0x7e }, /* '|' => '~' */
        { 0, 0 }
 };
 
index 75bf565ce20a2b13e9c778f72a061339993ee7dc..3133c15616d6900875fc08ae7b206d99824baa78 100644 (file)
@@ -40,11 +40,16 @@ static struct keymap_key pt_basic[] = {
 
 /** "pt" AltGr remapping */
 static struct keymap_key pt_altgr[] = {
+       { 0x26, 0x7b }, /* '&' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x32, 0x40 }, /* '2' => '@' */
        { 0x37, 0x7b }, /* '7' => '{' */
        { 0x38, 0x5b }, /* '8' => '[' */
        { 0x39, 0x5d }, /* '9' => ']' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x71, 0x40 }, /* 'q' => '@' */
        { 0, 0 }
 };
index 9c6cf64a407e5ea158a41ad16b0efb4249811247..2bac9698598faa79e3634eb68e3a27e93a0b59ea 100644 (file)
@@ -37,6 +37,10 @@ static struct keymap_key se_basic[] = {
 
 /** "se" AltGr remapping */
 static struct keymap_key se_altgr[] = {
+       { 0x26, 0x7b }, /* '&' => '{' */
+       { 0x28, 0x5d }, /* '(' => ']' */
+       { 0x29, 0x7d }, /* ')' => '}' */
+       { 0x2a, 0x5b }, /* '*' => '[' */
        { 0x2d, 0x5c }, /* '-' => '\\' */
        { 0x30, 0x7d }, /* '0' => '}' */
        { 0x32, 0x40 }, /* '2' => '@' */
@@ -44,7 +48,9 @@ static struct keymap_key se_altgr[] = {
        { 0x37, 0x7b }, /* '7' => '{' */
        { 0x38, 0x5b }, /* '8' => '[' */
        { 0x39, 0x5d }, /* '9' => ']' */
+       { 0x51, 0x40 }, /* 'Q' => '@' */
        { 0x5d, 0x7e }, /* ']' => '~' */
+       { 0x5f, 0x5c }, /* '_' => '\\' */
        { 0x71, 0x40 }, /* 'q' => '@' */
        { 0xdc, 0x7c }, /* Pseudo-'\\' => '|' */
        { 0, 0 }
index 2afe59c615d53d818582ce9acb3a0c7e1c3cf425..c4200099a654493f4762d4b6e886959b3e28066b 100644 (file)
@@ -45,12 +45,19 @@ static struct keymap_key sg_basic[] = {
 
 /** "sg" AltGr remapping */
 static struct keymap_key sg_altgr[] = {
+       { 0x22, 0x7b }, /* '"' => '{' */
+       { 0x26, 0x7c }, /* '&' => '|' */
        { 0x27, 0x7b }, /* '\'' => '{' */
+       { 0x2b, 0x7e }, /* '+' => '~' */
        { 0x32, 0x40 }, /* '2' => '@' */
        { 0x33, 0x23 }, /* '3' => '#' */
        { 0x37, 0x7c }, /* '7' => '|' */
        { 0x3d, 0x7e }, /* '=' => '~' */
        { 0x5c, 0x7d }, /* '\\' => '}' */
+       { 0x7b, 0x5b }, /* '{' => '[' */
+       { 0x7c, 0x7d }, /* '|' => '}' */
+       { 0x7d, 0x5d }, /* '}' => ']' */
+       { 0xfc, 0x5c }, /* Pseudo-'|' => '\\' */
        { 0, 0 }
 };
 
index 9fd9874779f74ee183d7ae38a486c148a009c471..b70ce5f720cff9e131d57f04a60c3049c87552b0 100755 (executable)
@@ -365,9 +365,11 @@ class Keymap:
         """AltGr remapping table"""
         # Construct raw mapping from source ASCII to target ASCII
         raw = {
-            source:
-            self.target.get((key.modifiers | KeyModifiers.ALTGR),
-                            self.target[key.modifiers])[key.keycode].ascii
+            source: next((self.target[x][key.keycode].ascii
+                          for x in (key.modifiers | KeyModifiers.ALTGR,
+                                    KeyModifiers.ALTGR, key.modifiers)
+                          if x in self.target
+                          and self.target[x][key.keycode].ascii), None)
             for source, key in self.source.inverse.items()
         }
         # Identify printable keys that are unreachable via the basic map