[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,8 +10,8 @@ FILE_LICENCE ( PUBLIC_DOMAIN );
#include <ipxe/keymap.h>
/** "nl" keyboard mapping */
struct key_mapping nl_mapping[] __keymap = {
/** "nl" basic remapping */
static struct keymap_key nl_basic[] = {
{ 0x1c, 0x3c }, /* 0x1c => '<' */
{ 0x1d, 0x1c }, /* 0x1d => 0x1c */
{ 0x1e, 0x36 }, /* 0x1e => '6' */
@@ -35,4 +35,11 @@ struct key_mapping nl_mapping[] __keymap = {
{ 0x7d, 0x7c }, /* '}' => '|' */
{ 0xdc, 0x5d }, /* Pseudo-'\\' => ']' */
{ 0xfc, 0x5b }, /* Pseudo-'|' => '[' */
{ 0, 0 }
};
/** "nl" keyboard map */
struct keymap nl_keymap __keymap = {
.name = "nl",
.basic = nl_basic,
};