summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2022-02-14 14:22:48 +0100
committerMichael Brown2022-02-15 12:58:47 +0100
commit871dd236d4aff66e871c25addcf522fe75a4ccd7 (patch)
tree92972b82b4469c1802a7b335d439e04aa0f8e604 /src/include
parent[tables] Add ability to declare static table start and end markers (diff)
downloadipxe-871dd236d4aff66e871c25addcf522fe75a4ccd7.tar.gz
ipxe-871dd236d4aff66e871c25addcf522fe75a4ccd7.tar.xz
ipxe-871dd236d4aff66e871c25addcf522fe75a4ccd7.zip
[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>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/keymap.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/include/ipxe/keymap.h b/src/include/ipxe/keymap.h
index 93c9e7314..a64ab9cd4 100644
--- a/src/include/ipxe/keymap.h
+++ b/src/include/ipxe/keymap.h
@@ -13,16 +13,29 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
#include <ipxe/tables.h>
-/** A keyboard mapping */
-struct key_mapping {
+/** A remapped key
+ *
+ * Represents a mapping from an ASCII character (as interpreted from a
+ * keyboard scancode by the US-only keyboard driver provided by the
+ * BIOS) to the appropriate ASCII value for the keyboard layout.
+ */
+struct keymap_key {
/** Character read from keyboard */
uint8_t from;
/** Character to be used instead */
uint8_t to;
} __attribute__ (( packed ));
+/** A keyboard mapping */
+struct keymap {
+ /** Name */
+ const char *name;
+ /** Basic remapping table (zero-terminated) */
+ struct keymap_key *basic;
+};
+
/** Keyboard mapping table */
-#define KEYMAP __table ( struct key_mapping, "keymap" )
+#define KEYMAP __table ( struct keymap, "keymap" )
/** Define a keyboard mapping */
#define __keymap __table_entry ( KEYMAP, 01 )