diff options
author | Michael Brown <mcb30@ipxe.org> | 2022-02-09 15:54:39 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2022-02-10 13:11:27 +0000 |
commit | f51a62bc3f7abb40e331c16df1f4d9314aefaf23 (patch) | |
tree | 8d204bf78ea8d77946eb467c4dd9dd894c4dfb0b /src/arch/x86 | |
parent | 64113751c3729a2deaffbb1e1b6fd36e2c8bac6b (diff) | |
download | ipxe-f51a62bc3f7abb40e331c16df1f4d9314aefaf23.tar.gz |
[console] Generalise bios_keymap() as key_remap()
Allow the keyboard remapping functionality to be exposed to consoles
other than the BIOS console.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86')
-rw-r--r-- | src/arch/x86/interface/pcbios/bios_console.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/arch/x86/interface/pcbios/bios_console.c b/src/arch/x86/interface/pcbios/bios_console.c index 80ebf330e..0692e7a6c 100644 --- a/src/arch/x86/interface/pcbios/bios_console.c +++ b/src/arch/x86/interface/pcbios/bios_console.c @@ -340,22 +340,6 @@ static const char * bios_ansi_seq ( unsigned int scancode ) { } /** - * Map a key - * - * @v character Character read from console - * @ret character Mapped character - */ -static int bios_keymap ( unsigned int character ) { - struct key_mapping *mapping; - - for_each_table_entry ( mapping, KEYMAP ) { - if ( mapping->from == character ) - return mapping->to; - } - return character; -} - -/** * Get character from BIOS console * * @ret character Character read from console @@ -387,7 +371,7 @@ static int bios_getchar ( void ) { /* If it's a normal character, just map and return it */ if ( character && ( character < 0x80 ) ) - return bios_keymap ( character ); + return key_remap ( character ); /* Otherwise, check for a special key that we know about */ if ( ( ansi_seq = bios_ansi_seq ( keypress >> 8 ) ) ) { |