Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

SimpleTextIn.h 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /** @file
  2. Simple Text Input protocol from the UEFI 2.0 specification.
  3. Abstraction of a very simple input device like a keyboard or serial
  4. terminal.
  5. Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
  6. This program and the accompanying materials
  7. are licensed and made available under the terms and conditions of the BSD License
  8. which accompanies this distribution. The full text of the license may be found at
  9. http://opensource.org/licenses/bsd-license.php
  10. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  12. **/
  13. #ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
  14. #define __SIMPLE_TEXT_IN_PROTOCOL_H__
  15. FILE_LICENCE ( BSD3 );
  16. #define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
  17. { \
  18. 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
  19. }
  20. typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
  21. ///
  22. /// Protocol GUID name defined in EFI1.1.
  23. ///
  24. #define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
  25. ///
  26. /// Protocol name in EFI1.1 for backward-compatible.
  27. ///
  28. typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;
  29. ///
  30. /// The keystroke information for the key that was pressed.
  31. ///
  32. typedef struct {
  33. UINT16 ScanCode;
  34. CHAR16 UnicodeChar;
  35. } EFI_INPUT_KEY;
  36. //
  37. // Required unicode control chars
  38. //
  39. #define CHAR_BACKSPACE 0x0008
  40. #define CHAR_TAB 0x0009
  41. #define CHAR_LINEFEED 0x000A
  42. #define CHAR_CARRIAGE_RETURN 0x000D
  43. //
  44. // EFI Scan codes
  45. //
  46. #define SCAN_NULL 0x0000
  47. #define SCAN_UP 0x0001
  48. #define SCAN_DOWN 0x0002
  49. #define SCAN_RIGHT 0x0003
  50. #define SCAN_LEFT 0x0004
  51. #define SCAN_HOME 0x0005
  52. #define SCAN_END 0x0006
  53. #define SCAN_INSERT 0x0007
  54. #define SCAN_DELETE 0x0008
  55. #define SCAN_PAGE_UP 0x0009
  56. #define SCAN_PAGE_DOWN 0x000A
  57. #define SCAN_F1 0x000B
  58. #define SCAN_F2 0x000C
  59. #define SCAN_F3 0x000D
  60. #define SCAN_F4 0x000E
  61. #define SCAN_F5 0x000F
  62. #define SCAN_F6 0x0010
  63. #define SCAN_F7 0x0011
  64. #define SCAN_F8 0x0012
  65. #define SCAN_F9 0x0013
  66. #define SCAN_F10 0x0014
  67. #define SCAN_ESC 0x0017
  68. /**
  69. Reset the input device and optionally run diagnostics
  70. @param This Protocol instance pointer.
  71. @param ExtendedVerification Driver may perform diagnostics on reset.
  72. @retval EFI_SUCCESS The device was reset.
  73. @retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset.
  74. **/
  75. typedef
  76. EFI_STATUS
  77. (EFIAPI *EFI_INPUT_RESET)(
  78. IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
  79. IN BOOLEAN ExtendedVerification
  80. );
  81. /**
  82. Reads the next keystroke from the input device. The WaitForKey Event can
  83. be used to test for existence of a keystroke via WaitForEvent () call.
  84. @param This Protocol instance pointer.
  85. @param Key A pointer to a buffer that is filled in with the keystroke
  86. information for the key that was pressed.
  87. @retval EFI_SUCCESS The keystroke information was returned.
  88. @retval EFI_NOT_READY There was no keystroke data available.
  89. @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
  90. hardware errors.
  91. **/
  92. typedef
  93. EFI_STATUS
  94. (EFIAPI *EFI_INPUT_READ_KEY)(
  95. IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
  96. OUT EFI_INPUT_KEY *Key
  97. );
  98. ///
  99. /// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
  100. /// It is the minimum required protocol for ConsoleIn.
  101. ///
  102. struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
  103. EFI_INPUT_RESET Reset;
  104. EFI_INPUT_READ_KEY ReadKeyStroke;
  105. ///
  106. /// Event to use with WaitForEvent() to wait for a key to be available
  107. ///
  108. EFI_EVENT WaitForKey;
  109. };
  110. extern EFI_GUID gEfiSimpleTextInProtocolGuid;
  111. #endif