mirror of
https://github.com/ipxe/ipxe
synced 2026-02-12 21:29:39 +03:00
[console] Centralise handling of key modifiers
Handle Ctrl and CapsLock key modifiers within key_remap(), to provide consistent behaviour across different console types. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -40,9 +40,30 @@ struct keymap {
|
||||
/** Define a keyboard mapping */
|
||||
#define __keymap __table_entry ( KEYMAP, 01 )
|
||||
|
||||
/** Mappable character mask */
|
||||
#define KEYMAP_MASK 0xff
|
||||
|
||||
/** Pseudo key flag */
|
||||
#define KEYMAP_PSEUDO 0x80
|
||||
|
||||
/** Ctrl key flag */
|
||||
#define KEYMAP_CTRL 0x0100
|
||||
|
||||
/** CapsLock key flag */
|
||||
#define KEYMAP_CAPSLOCK 0x0200
|
||||
|
||||
/** Undo CapsLock key flag
|
||||
*
|
||||
* Used when the keyboard driver has already interpreted the CapsLock
|
||||
* key, in which case the effect needs to be undone before remapping
|
||||
* in order to correctly handle keyboard mappings that swap alphabetic
|
||||
* and non-alphabetic keys.
|
||||
*/
|
||||
#define KEYMAP_CAPSLOCK_UNDO 0x0400
|
||||
|
||||
/** Undo and redo CapsLock key flags */
|
||||
#define KEYMAP_CAPSLOCK_REDO ( KEYMAP_CAPSLOCK | KEYMAP_CAPSLOCK_UNDO )
|
||||
|
||||
extern unsigned int key_remap ( unsigned int character );
|
||||
|
||||
#endif /* _IPXE_KEYMAP_H */
|
||||
|
||||
Reference in New Issue
Block a user