diff options
| author | Michael Brown | 2022-02-14 14:45:59 +0100 |
|---|---|---|
| committer | Michael Brown | 2022-02-15 13:50:26 +0100 |
| commit | e1cedbc0d4fdb0e16818f6b722f4873a50780761 (patch) | |
| tree | 498de03ad0d5157c73479274569ea992cb47101c /src/core | |
| parent | [console] Centralise handling of key modifiers (diff) | |
| download | ipxe-e1cedbc0d4fdb0e16818f6b722f4873a50780761.tar.gz ipxe-e1cedbc0d4fdb0e16818f6b722f4873a50780761.tar.xz ipxe-e1cedbc0d4fdb0e16818f6b722f4873a50780761.zip | |
[console] Support AltGr to access ASCII characters via remapping
Several keyboard layouts define ASCII characters as accessible only
via the AltGr modifier. Add support for this modifier to ensure that
all ASCII characters are accessible.
Experiments suggest that the BIOS console is likely to fail to
generate ASCII characters when the AltGr key is pressed. Work around
this limitation by accepting LShift+RShift (which will definitely
produce an ASCII character) as a synonym for AltGr.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/keymap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/keymap.c b/src/core/keymap.c index a5209bc20..3fa85f74e 100644 --- a/src/core/keymap.c +++ b/src/core/keymap.c @@ -65,8 +65,11 @@ unsigned int key_remap ( unsigned int character ) { if ( ( character & KEYMAP_CAPSLOCK_UNDO ) && isalpha ( mapped ) ) mapped ^= CASE_TOGGLE; + /* Select remapping table */ + key = ( ( character & KEYMAP_ALTGR ) ? keymap->altgr : keymap->basic ); + /* Remap via table */ - for ( key = keymap->basic ; key->from ; key++ ) { + for ( ; key->from ; key++ ) { if ( mapped == key->from ) { mapped = key->to; break; |
