[console] Handle remapping of scancode 86

The key with scancode 86 appears in the position between left shift
and Z on a US keyboard, where it typically fails to exist entirely.
Most US keyboard maps define this nonexistent key as generating "\|",
with the notable exception of "loadkeys" which instead reports it as
generating "<>".  Both of these mapping choices duplicate keys that
exist elsewhere in the map, which causes problems for our ASCII-based
remapping mechanism.

Work around these quirks by treating the key as generating "\|" with
the high bit set, and making it subject to remapping.  Where the BIOS
generates "\|" as expected, this allows us to remap to the correct
ASCII value.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2022-02-09 15:43:42 +00:00
parent 3f05a82fec
commit 0bbd896783
28 changed files with 93 additions and 6 deletions

View File

@@ -30,4 +30,6 @@ struct key_mapping al_mapping[] __keymap = {
{ 0x7c, 0x7d }, /* '|' => '}' */
{ 0x7d, 0x27 }, /* '}' => '\'' */
{ 0x7e, 0x7c }, /* '~' => '|' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -21,4 +21,6 @@ struct key_mapping az_mapping[] __keymap = {
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5e, 0x3a }, /* '^' => ':' */
{ 0x7c, 0x2f }, /* '|' => '/' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -12,4 +12,6 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
/** "by" keyboard mapping */
struct key_mapping by_mapping[] __keymap = {
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -36,4 +36,6 @@ struct key_mapping de_mapping[] __keymap = {
{ 0x7a, 0x79 }, /* 'z' => 'y' */
{ 0x7c, 0x27 }, /* '|' => '\'' */
{ 0x7d, 0x2a }, /* '}' => '*' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -28,4 +28,6 @@ struct key_mapping dk_mapping[] __keymap = {
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7c, 0x2a }, /* '|' => '*' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -28,4 +28,6 @@ struct key_mapping es_mapping[] __keymap = {
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7d, 0x2a }, /* '}' => '*' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -26,4 +26,6 @@ struct key_mapping et_mapping[] __keymap = {
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7c, 0x2a }, /* '|' => '*' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -26,4 +26,6 @@ struct key_mapping fi_mapping[] __keymap = {
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7c, 0x2a }, /* '|' => '*' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -57,4 +57,6 @@ struct key_mapping fr_mapping[] __keymap = {
{ 0x71, 0x61 }, /* 'q' => 'a' */
{ 0x77, 0x7a }, /* 'w' => 'z' */
{ 0x7a, 0x77 }, /* 'z' => 'w' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -12,4 +12,6 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
/** "gr" keyboard mapping */
struct key_mapping gr_mapping[] __keymap = {
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -24,4 +24,6 @@ struct key_mapping il_mapping[] __keymap = {
{ 0x60, 0x3b }, /* '`' => ';' */
{ 0x7b, 0x7d }, /* '{' => '}' */
{ 0x7d, 0x7b }, /* '}' => '{' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -30,4 +30,6 @@ struct key_mapping it_mapping[] __keymap = {
{ 0x60, 0x5c }, /* '`' => '\\' */
{ 0x7d, 0x2a }, /* '}' => '*' */
{ 0x7e, 0x7c }, /* '~' => '|' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -12,4 +12,6 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
/** "mk" keyboard mapping */
struct key_mapping mk_mapping[] __keymap = {
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -33,4 +33,6 @@ struct key_mapping nl_mapping[] __keymap = {
{ 0x60, 0x40 }, /* '`' => '@' */
{ 0x7c, 0x3e }, /* '|' => '>' */
{ 0x7d, 0x7c }, /* '}' => '|' */
{ 0xdc, 0x5d }, /* Pseudo-'\\' => ']' */
{ 0xfc, 0x5b }, /* Pseudo-'|' => '[' */
};

View File

@@ -32,4 +32,6 @@ struct key_mapping no_latin1_mapping[] __keymap = {
{ 0x60, 0x7c }, /* '`' => '|' */
{ 0x7c, 0x2a }, /* '|' => '*' */
{ 0x7d, 0x5e }, /* '}' => '^' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -30,4 +30,6 @@ struct key_mapping no_mapping[] __keymap = {
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x60, 0x7c }, /* '`' => '|' */
{ 0x7c, 0x2a }, /* '|' => '*' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -12,4 +12,6 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
/** "pl" keyboard mapping */
struct key_mapping pl_mapping[] __keymap = {
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -29,4 +29,6 @@ struct key_mapping pt_mapping[] __keymap = {
{ 0x60, 0x5c }, /* '`' => '\\' */
{ 0x7b, 0x2a }, /* '{' => '*' */
{ 0x7e, 0x7c }, /* '~' => '|' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -13,4 +13,6 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
/** "ru" keyboard mapping */
struct key_mapping ru_mapping[] __keymap = {
{ 0x0d, 0x0a }, /* Ctrl-M => Ctrl-J */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -38,4 +38,6 @@ struct key_mapping sg_mapping[] __keymap = {
{ 0x7a, 0x79 }, /* 'z' => 'y' */
{ 0x7c, 0x24 }, /* '|' => '$' */
{ 0x7d, 0x21 }, /* '}' => '!' */
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -12,4 +12,6 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
/** "sr-latin" keyboard mapping */
struct key_mapping sr_latin_mapping[] __keymap = {
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};

View File

@@ -12,4 +12,6 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
/** "ua" keyboard mapping */
struct key_mapping ua_mapping[] __keymap = {
{ 0xdc, 0x3c }, /* Pseudo-'\\' => '<' */
{ 0xfc, 0x3e }, /* Pseudo-'|' => '>' */
};