From f51a62bc3f7abb40e331c16df1f4d9314aefaf23 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 9 Feb 2022 15:54:39 +0000 Subject: [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 --- src/arch/x86/interface/pcbios/bios_console.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/arch/x86/interface') 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 @@ -339,22 +339,6 @@ static const char * bios_ansi_seq ( unsigned int scancode ) { return NULL; } -/** - * 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 * @@ -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 ) ) ) { -- cgit v1.2.3-55-g7522