Skip to content

Commit

Permalink
[console] Add keymap generator
Browse files Browse the repository at this point in the history
Inspired by LILO's keytab-lilo.pl, genkeymap.pl uses "loadkeys -b" to
obtain a Linux keyboard map, and generates a file keymap_xx.c in
hci/keymap.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 16, 2011
1 parent f98cf7d commit 1febd87
Show file tree
Hide file tree
Showing 35 changed files with 1,160 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Makefile
Expand Up @@ -45,6 +45,7 @@ ELF2EFI64 := ./util/elf2efi64
EFIROM := ./util/efirom
ICCFIX := ./util/iccfix
EINFO := ./util/einfo
GENKEYMAP := ./util/genkeymap.pl
DOXYGEN := doxygen
BINUTILS_DIR := /usr
BFD_DIR := $(BINUTILS_DIR)
Expand Down Expand Up @@ -80,6 +81,7 @@ SRCDIRS += tests
SRCDIRS += crypto crypto/axtls crypto/matrixssl
SRCDIRS += hci hci/commands hci/tui
SRCDIRS += hci/mucurses hci/mucurses/widgets
SRCDIRS += hci/keymap
SRCDIRS += usr
SRCDIRS += config

Expand Down
8 changes: 8 additions & 0 deletions src/Makefile.housekeeping
Expand Up @@ -1085,6 +1085,14 @@ docview :

endif # defined(BIN)

###############################################################################
#
# Keyboard maps
#

hci/keymap/keymap_%.c : $(GENKEYMAP)
$(Q)$(PERL) $(GENKEYMAP) $* > $@

###############################################################################
#
# Clean-up
Expand Down
31 changes: 31 additions & 0 deletions src/hci/keymap/keymap_al.c
@@ -0,0 +1,31 @@
/** @file
*
* "al" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "al" keyboard mapping */
struct key_mapping al_mapping[] __keymap = {
{ 0x19, 0x1a }, /* Ctrl-Y => Ctrl-Z */
{ 0x1a, 0x19 }, /* Ctrl-Z => Ctrl-Y */
{ 0x22, 0x7b }, /* '"' => '{' */
{ 0x27, 0x5b }, /* '\'' => '[' */
{ 0x3e, 0x3a }, /* '>' => ':' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x59, 0x5a }, /* 'Y' => 'Z' */
{ 0x5a, 0x59 }, /* 'Z' => 'Y' */
{ 0x5c, 0x5d }, /* '\\' => ']' */
{ 0x5d, 0x40 }, /* ']' => '@' */
{ 0x60, 0x5c }, /* '`' => '\\' */
{ 0x79, 0x7a }, /* 'y' => 'z' */
{ 0x7a, 0x79 }, /* 'z' => 'y' */
{ 0x7c, 0x7d }, /* '|' => '}' */
{ 0x7d, 0x27 }, /* '}' => '\'' */
{ 0x7e, 0x7c }, /* '~' => '|' */
};
24 changes: 24 additions & 0 deletions src/hci/keymap/keymap_az.c
@@ -0,0 +1,24 @@
/** @file
*
* "az" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "az" keyboard mapping */
struct key_mapping az_mapping[] __keymap = {
{ 0x23, 0x27 }, /* '#' => '\'' */
{ 0x24, 0x3b }, /* '$' => ';' */
{ 0x26, 0x3f }, /* '&' => '?' */
{ 0x2f, 0x2e }, /* '/' => '.' */
{ 0x3a, 0x49 }, /* ':' => 'I' */
{ 0x3f, 0x2c }, /* '?' => ',' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5e, 0x3a }, /* '^' => ':' */
{ 0x7c, 0x2f }, /* '|' => '/' */
};
15 changes: 15 additions & 0 deletions src/hci/keymap/keymap_bg.c
@@ -0,0 +1,15 @@
/** @file
*
* "bg" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "bg" keyboard mapping */
struct key_mapping bg_mapping[] __keymap = {
};
15 changes: 15 additions & 0 deletions src/hci/keymap/keymap_by.c
@@ -0,0 +1,15 @@
/** @file
*
* "by" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "by" keyboard mapping */
struct key_mapping by_mapping[] __keymap = {
};
24 changes: 24 additions & 0 deletions src/hci/keymap/keymap_cf.c
@@ -0,0 +1,24 @@
/** @file
*
* "cf" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "cf" keyboard mapping */
struct key_mapping cf_mapping[] __keymap = {
{ 0x23, 0x2f }, /* '#' => '/' */
{ 0x3c, 0x27 }, /* '<' => '\'' */
{ 0x3e, 0x2e }, /* '>' => '.' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5c, 0x3c }, /* '\\' => '<' */
{ 0x5e, 0x3f }, /* '^' => '?' */
{ 0x60, 0x23 }, /* '`' => '#' */
{ 0x7c, 0x3e }, /* '|' => '>' */
{ 0x7e, 0x7c }, /* '~' => '|' */
};
27 changes: 27 additions & 0 deletions src/hci/keymap/keymap_cz.c
@@ -0,0 +1,27 @@
/** @file
*
* "cz" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "cz" keyboard mapping */
struct key_mapping cz_mapping[] __keymap = {
{ 0x21, 0x2b }, /* '!' => '+' */
{ 0x2d, 0x3d }, /* '-' => '=' */
{ 0x2f, 0x2d }, /* '/' => '-' */
{ 0x31, 0x2b }, /* '1' => '+' */
{ 0x3c, 0x5c }, /* '<' => '\\' */
{ 0x3e, 0x2e }, /* '>' => '.' */
{ 0x3f, 0x2d }, /* '?' => '-' */
{ 0x5d, 0x29 }, /* ']' => ')' */
{ 0x5f, 0x3d }, /* '_' => '=' */
{ 0x60, 0x3b }, /* '`' => ';' */
{ 0x7d, 0x29 }, /* '}' => ')' */
{ 0x7e, 0x3b }, /* '~' => ';' */
};
45 changes: 45 additions & 0 deletions src/hci/keymap/keymap_de.c
@@ -0,0 +1,45 @@
/** @file
*
* "de" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "de" keyboard mapping */
struct key_mapping de_mapping[] __keymap = {
{ 0x19, 0x1a }, /* Ctrl-Y => Ctrl-Z */
{ 0x1a, 0x19 }, /* Ctrl-Z => Ctrl-Y */
{ 0x22, 0x7d }, /* '"' => '}' */
{ 0x26, 0x2f }, /* '&' => '/' */
{ 0x27, 0x5d }, /* '\'' => ']' */
{ 0x28, 0x29 }, /* '(' => ')' */
{ 0x29, 0x3d }, /* ')' => '=' */
{ 0x2a, 0x28 }, /* '*' => '(' */
{ 0x2b, 0x60 }, /* '+' => '`' */
{ 0x2d, 0x5c }, /* '-' => '\\' */
{ 0x2f, 0x2d }, /* '/' => '-' */
{ 0x3a, 0x7b }, /* ':' => '{' */
{ 0x3b, 0x5b }, /* ';' => '[' */
{ 0x3d, 0x27 }, /* '=' => '\'' */
{ 0x3e, 0x3a }, /* '>' => ':' */
{ 0x3f, 0x5f }, /* '?' => '_' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x59, 0x5a }, /* 'Y' => 'Z' */
{ 0x5a, 0x59 }, /* 'Z' => 'Y' */
{ 0x5b, 0x40 }, /* '[' => '@' */
{ 0x5c, 0x23 }, /* '\\' => '#' */
{ 0x5d, 0x2b }, /* ']' => '+' */
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x60, 0x5e }, /* '`' => '^' */
{ 0x79, 0x7a }, /* 'y' => 'z' */
{ 0x7a, 0x79 }, /* 'z' => 'y' */
{ 0x7b, 0x5c }, /* '{' => '\\' */
{ 0x7c, 0x27 }, /* '|' => '\'' */
{ 0x7d, 0x2a }, /* '}' => '*' */
};
30 changes: 30 additions & 0 deletions src/hci/keymap/keymap_dk.c
@@ -0,0 +1,30 @@
/** @file
*
* "dk" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "dk" keyboard mapping */
struct key_mapping dk_mapping[] __keymap = {
{ 0x26, 0x2f }, /* '&' => '/' */
{ 0x28, 0x29 }, /* '(' => ')' */
{ 0x29, 0x3d }, /* ')' => '=' */
{ 0x2a, 0x28 }, /* '*' => '(' */
{ 0x2b, 0x60 }, /* '+' => '`' */
{ 0x2d, 0x2b }, /* '-' => '+' */
{ 0x2f, 0x2d }, /* '/' => '-' */
{ 0x3e, 0x3a }, /* '>' => ':' */
{ 0x3f, 0x5f }, /* '?' => '_' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5c, 0x27 }, /* '\\' => '\'' */
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7c, 0x2a }, /* '|' => '*' */
{ 0x7d, 0x5e }, /* '}' => '^' */
};
28 changes: 28 additions & 0 deletions src/hci/keymap/keymap_es.c
@@ -0,0 +1,28 @@
/** @file
*
* "es" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "es" keyboard mapping */
struct key_mapping es_mapping[] __keymap = {
{ 0x26, 0x2f }, /* '&' => '/' */
{ 0x28, 0x29 }, /* '(' => ')' */
{ 0x29, 0x3d }, /* ')' => '=' */
{ 0x2a, 0x28 }, /* '*' => '(' */
{ 0x2d, 0x27 }, /* '-' => '\'' */
{ 0x2f, 0x2d }, /* '/' => '-' */
{ 0x3e, 0x3a }, /* '>' => ':' */
{ 0x3f, 0x5f }, /* '?' => '_' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5d, 0x2b }, /* ']' => '+' */
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7d, 0x2a }, /* '}' => '*' */
};
28 changes: 28 additions & 0 deletions src/hci/keymap/keymap_et.c
@@ -0,0 +1,28 @@
/** @file
*
* "et" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "et" keyboard mapping */
struct key_mapping et_mapping[] __keymap = {
{ 0x26, 0x2f }, /* '&' => '/' */
{ 0x28, 0x29 }, /* '(' => ')' */
{ 0x29, 0x3d }, /* ')' => '=' */
{ 0x2a, 0x28 }, /* '*' => '(' */
{ 0x2d, 0x2b }, /* '-' => '+' */
{ 0x2f, 0x2d }, /* '/' => '-' */
{ 0x3e, 0x3a }, /* '>' => ':' */
{ 0x3f, 0x5f }, /* '?' => '_' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5c, 0x27 }, /* '\\' => '\'' */
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7c, 0x2a }, /* '|' => '*' */
};
37 changes: 37 additions & 0 deletions src/hci/keymap/keymap_fi.c
@@ -0,0 +1,37 @@
/** @file
*
* "fi" keyboard mapping
*
* This file is automatically generated; do not edit
*
*/

FILE_LICENCE ( PUBLIC_DOMAIN );

#include <ipxe/keymap.h>

/** "fi" keyboard mapping */
struct key_mapping fi_mapping[] __keymap = {
{ 0x22, 0x5b }, /* '"' => '[' */
{ 0x26, 0x2f }, /* '&' => '/' */
{ 0x27, 0x7b }, /* '\'' => '{' */
{ 0x28, 0x29 }, /* '(' => ')' */
{ 0x29, 0x3d }, /* ')' => '=' */
{ 0x2a, 0x28 }, /* '*' => '(' */
{ 0x2b, 0x60 }, /* '+' => '`' */
{ 0x2d, 0x2b }, /* '-' => '+' */
{ 0x2f, 0x2d }, /* '/' => '-' */
{ 0x3a, 0x5c }, /* ':' => '\\' */
{ 0x3b, 0x7c }, /* ';' => '|' */
{ 0x3d, 0x27 }, /* '=' => '\'' */
{ 0x3e, 0x3a }, /* '>' => ':' */
{ 0x3f, 0x5f }, /* '?' => '_' */
{ 0x40, 0x22 }, /* '@' => '"' */
{ 0x5b, 0x7d }, /* '[' => '}' */
{ 0x5c, 0x27 }, /* '\\' => '\'' */
{ 0x5e, 0x26 }, /* '^' => '&' */
{ 0x5f, 0x3f }, /* '_' => '?' */
{ 0x7b, 0x5d }, /* '{' => ']' */
{ 0x7c, 0x2a }, /* '|' => '*' */
{ 0x7d, 0x5e }, /* '}' => '^' */
};

0 comments on commit 1febd87

Please sign in to comment.