You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

keys.h 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _GPXE_KEYS_H
  2. #define _GPXE_KEYS_H
  3. /** @file
  4. *
  5. * Key definitions
  6. *
  7. */
  8. /*
  9. * Symbolic names for some standard ASCII characters
  10. *
  11. */
  12. #define NUL 0x00
  13. #define CTRL_A 0x01
  14. #define CTRL_B 0x02
  15. #define CTRL_C 0x03
  16. #define CTRL_D 0x04
  17. #define CTRL_E 0x05
  18. #define CTRL_F 0x06
  19. #define CTRL_G 0x07
  20. #define CTRL_H 0x08
  21. #define CTRL_I 0x09
  22. #define CTRL_J 0x0a
  23. #define CTRL_K 0x0b
  24. #define CTRL_L 0x0c
  25. #define CTRL_M 0x0d
  26. #define CTRL_N 0x0e
  27. #define CTRL_O 0x0f
  28. #define CTRL_P 0x10
  29. #define CTRL_Q 0x11
  30. #define CTRL_R 0x12
  31. #define CTRL_S 0x13
  32. #define CTRL_T 0x14
  33. #define CTRL_U 0x15
  34. #define CTRL_V 0x16
  35. #define CTRL_W 0x17
  36. #define CTRL_X 0x18
  37. #define CTRL_Y 0x19
  38. #define CTRL_Z 0x1a
  39. #define BACKSPACE CTRL_H
  40. #define TAB CTRL_I
  41. #define LF CTRL_J
  42. #define CR CTRL_M
  43. #define ESC 0x1b
  44. /*
  45. * Special keys outside the normal ASCII range
  46. *
  47. *
  48. * The names are chosen to match those used by curses. The values are
  49. * chosen to facilitate easy conversion from a received ANSI escape
  50. * sequence to a KEY_XXX constant.
  51. */
  52. #define KEY_ANSI( n, terminator ) ( 0x100 * ( (n) + 1 ) + (terminator) )
  53. #define KEY_MIN 0x101
  54. #define KEY_UP KEY_ANSI ( 0, 'A' ) /**< Up arrow */
  55. #define KEY_DOWN KEY_ANSI ( 0, 'B' ) /**< Down arrow */
  56. #define KEY_RIGHT KEY_ANSI ( 0, 'C' ) /**< Right arrow */
  57. #define KEY_LEFT KEY_ANSI ( 0, 'D' ) /**< Left arrow */
  58. #define KEY_END KEY_ANSI ( 0, 'F' ) /**< End */
  59. #define KEY_HOME KEY_ANSI ( 0, 'H' ) /**< Home */
  60. #define KEY_IC KEY_ANSI ( 2, '~' ) /**< Insert */
  61. #define KEY_DC KEY_ANSI ( 3, '~' ) /**< Delete */
  62. #define KEY_PPAGE KEY_ANSI ( 5, '~' ) /**< Page up */
  63. #define KEY_NPAGE KEY_ANSI ( 6, '~' ) /**< Page down */
  64. #define KEY_F8 KEY_ANSI ( 19, '~' ) /**< F8 (for PXE) */
  65. /* Not in the [KEY_MIN,KEY_MAX] range; terminals seem to send these as
  66. * normal ASCII values.
  67. */
  68. #define KEY_BACKSPACE BACKSPACE
  69. #define KEY_ENTER LF
  70. #endif /* _GPXE_KEYS_H */