mirror of
https://github.com/ipxe/ipxe
synced 2025-12-16 09:32:33 +03:00
[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:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user