From f98cf7d70f3d32e19ca6aabbd9601c0d432ea67f Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 16 Mar 2011 03:17:34 +0000 Subject: [console] Add facility for rudimentary keyboard mapping Allow for remapping of ASCII characters returned by the BIOS, using a map consisting of (from,to) pairs. Signed-off-by: Michael Brown --- src/include/ipxe/keymap.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/include/ipxe/keymap.h (limited to 'src/include/ipxe') diff --git a/src/include/ipxe/keymap.h b/src/include/ipxe/keymap.h new file mode 100644 index 000000000..9ac42a6b1 --- /dev/null +++ b/src/include/ipxe/keymap.h @@ -0,0 +1,30 @@ +#ifndef _IPXE_KEYMAP_H +#define _IPXE_KEYMAP_H + +/** + * @file + * + * Keyboard mappings + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include +#include + +/** A keyboard mapping */ +struct key_mapping { + /** Character read from keyboard */ + uint8_t from; + /** Character to be used instead */ + uint8_t to; +} __attribute__ (( packed )); + +/** Keyboard mapping table */ +#define KEYMAP __table ( struct key_mapping, "keymap" ) + +/** Define a keyboard mapping */ +#define __keymap __table_entry ( KEYMAP, 01 ) + +#endif /* _IPXE_KEYMAP_H */ -- cgit v1.2.3-55-g7522