eficonex.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef _EFI_CONEX_H
  2. #define _EFI_CONEX_H
  3. /*++
  4. Copyright (c) 2020 Kagurazaka Kotori <[email protected]>
  5. Module Name:
  6. eficonex.h
  7. Abstract:
  8. EFI console extension protocols
  9. --*/
  10. //
  11. // Simple Text Input Ex Protocol
  12. //
  13. #define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
  14. { 0xdd9e7534, 0x7762, 0x4698, {0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa} }
  15. INTERFACE_DECL(_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL);
  16. typedef UINT8 EFI_KEY_TOGGLE_STATE;
  17. typedef struct EFI_KEY_STATE {
  18. UINT32 KeyShiftState;
  19. EFI_KEY_TOGGLE_STATE KeyToggleState;
  20. } EFI_KEY_STATE;
  21. typedef struct {
  22. EFI_INPUT_KEY Key;
  23. EFI_KEY_STATE KeyState;
  24. } EFI_KEY_DATA;
  25. // Shift states
  26. #define EFI_SHIFT_STATE_VALID 0x80000000
  27. #define EFI_RIGHT_SHIFT_PRESSED 0x00000001
  28. #define EFI_LEFT_SHIFT_PRESSED 0x00000002
  29. #define EFI_RIGHT_CONTROL_PRESSED 0x00000004
  30. #define EFI_LEFT_CONTROL_PRESSED 0x00000008
  31. #define EFI_RIGHT_ALT_PRESSED 0x00000010
  32. #define EFI_LEFT_ALT_PRESSED 0x00000020
  33. #define EFI_RIGHT_LOGO_PRESSED 0x00000040
  34. #define EFI_LEFT_LOGO_PRESSED 0x00000080
  35. #define EFI_MENU_KEY_PRESSED 0x00000100
  36. #define EFI_SYS_REQ_PRESSED 0x00000200
  37. // Toggle states
  38. #define EFI_TOGGLE_STATE_VALID 0x80
  39. #define EFI_KEY_STATE_EXPOSED 0x40
  40. #define EFI_SCROLL_LOCK_ACTIVE 0x01
  41. #define EFI_NUM_LOCK_ACTIVE 0x02
  42. #define EFI_CAPS_LOCK_ACTIVE 0x04
  43. typedef
  44. EFI_STATUS
  45. (EFIAPI *EFI_INPUT_RESET_EX) (
  46. IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
  47. IN BOOLEAN ExtendedVerification
  48. );
  49. typedef
  50. EFI_STATUS
  51. (EFIAPI *EFI_INPUT_READ_KEY_EX) (
  52. IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
  53. OUT EFI_KEY_DATA *KeyData
  54. );
  55. typedef
  56. EFI_STATUS
  57. (EFIAPI *EFI_SET_STATE) (
  58. IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
  59. IN EFI_KEY_TOGGLE_STATE *KeyToggleState
  60. );
  61. typedef
  62. EFI_STATUS
  63. (EFIAPI *EFI_KEY_NOTIFY_FUNCTION) (
  64. IN EFI_KEY_DATA *KeyData
  65. );
  66. typedef
  67. EFI_STATUS
  68. (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) (
  69. IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
  70. IN EFI_KEY_DATA *KeyData,
  71. IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
  72. OUT VOID **NotifyHandle
  73. );
  74. typedef
  75. EFI_STATUS
  76. (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) (
  77. IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
  78. IN VOID *NotificationHandle
  79. );
  80. typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL{
  81. EFI_INPUT_RESET_EX Reset;
  82. EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx;
  83. EFI_EVENT WaitForKeyEx;
  84. EFI_SET_STATE SetState;
  85. EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;
  86. EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;
  87. } EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
  88. #endif