aboutsummaryrefslogtreecommitdiff
path: root/src/util/genkeymap.py
AgeCommit message (Collapse)AuthorFilesLines
2022-02-16[console] Include mappings for AltGr-Shift-<key>Michael Brown1-3/+5
The BIOS console's interpretation of LShift+RShift as equivalent to AltGr requires the shifted ASCII characters to be present in the AltGr mapping table, to allow AltGr-Shift-<key> to be interpreted in the same way as AltGr-<key>. For keyboard layouts that have different ASCII characters for AltGr-<key> and AltGr-Shift-<key>, this will potentially leave the character for AltGr-<key> inaccessible via the BIOS console if the BIOS requires the use of the LShift+RShift workaround. This theoretically affects the numeric keys in the Lithuanian ("lt") keyboard layout (where the numerals are accessed via AltGr-<key> and punctuation characters via AltGr-Shift-<key>), but the simple workaround for that keyboard layout is to avoid using AltGr and Shift entirely since the unmodified numeric keys are not remapped anyway. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[console] Ensure that US keyboard map appears at start of linker tableMichael Brown1-1/+2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Fix definition of unreachability for remapped keysMichael Brown1-23/+23
The AltGr remapping table is constructed to include only keys that are not reachable after applying the basic remapping table. The logic currently fails to include keys that are omitted entirely from the basic remapping table since they would map to a non-ASCII character. Fix this logic by allowing the remapping tables to include null mappings, which are then elided only at the point of constructing the C code fragment. Reported-by: Christian Nilsson <nikize@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Ensure that all ASCII characters are reachable in all keymapsMichael Brown1-0/+6
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Fix unreachable characters in "mt" keymapMichael Brown1-0/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Fix unreachable characters in "il" keymapMichael Brown1-0/+6
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Treat dead keys as producing their ASCII equivalentsMichael Brown1-2/+20
Treat dead keys in target keymaps as producing the closest equivalent ASCII character, since many of these characters are otherwise unrepresented on the keyboard. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Support AltGr to access ASCII characters via remappingMichael Brown1-4/+36
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>
2022-02-15[console] Allow for named keyboard mappingsMichael Brown1-63/+77
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>
2022-02-10[console] Handle remapping of scancode 86Michael Brown1-5/+26
The key with scancode 86 appears in the position between left shift and Z on a US keyboard, where it typically fails to exist entirely. Most US keyboard maps define this nonexistent key as generating "\|", with the notable exception of "loadkeys" which instead reports it as generating "<>". Both of these mapping choices duplicate keys that exist elsewhere in the map, which causes problems for our ASCII-based remapping mechanism. Work around these quirks by treating the key as generating "\|" with the high bit set, and making it subject to remapping. Where the BIOS generates "\|" as expected, this allows us to remap to the correct ASCII value. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[console] Update genkeymap to work with current databasesMichael Brown1-0/+346
Rewrite genkeymap.pl in Python with added sanity checks, and update the list of keyboard mappings to remove those no longer supported by the underlying "loadkeys" tool. Signed-off-by: Michael Brown <mcb30@ipxe.org>