[console] Allow for named keyboard mappings

Separate the concept of a keyboard mapping from a list of remapped
keys, to allow for the possibility of supporting multiple keyboard
mappings at runtime.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2022-02-14 13:22:48 +00:00
parent 1150321595
commit 871dd236d4
33 changed files with 373 additions and 130 deletions

View File

@@ -10,11 +10,18 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
#include <ipxe/keymap.h>
/** "mt" keyboard mapping */
struct key_mapping mt_mapping[] __keymap = {
/** "mt" basic remapping */
static struct keymap_key mt_basic[] = {
{ 0x1c, 0x1e }, /* 0x1c => 0x1e */
{ 0x22, 0x40 }, /* '"' => '@' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5c, 0x23 }, /* '\\' => '#' */
{ 0x7c, 0x7e }, /* '|' => '~' */
{ 0, 0 }
};
/** "mt" keyboard map */
struct keymap mt_keymap __keymap = {
.name = "mt",
.basic = mt_basic,
};