No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

63 líneas
1.3KB

  1. #ifndef KEYS_H
  2. #define KEYS_H
  3. #include <ncurses.h>
  4. /* Key macros */
  5. /* These macros are not guaranteed to be defined,
  6. * however we wish to test for these anyways while
  7. * interpretting user commands.
  8. * Input values are guaranteed to be postive,
  9. * so setting them to -1 means the test always just silently fail,
  10. * but compile when the they are not supported means of input.
  11. */
  12. #define KEY_UNDEF_BASE 0
  13. #ifndef KEY_DOWN
  14. # define KEY_DOWN KEY_UNDEF_BASE - 1
  15. #endif
  16. #ifndef KEY_UP
  17. # define KEY_UP KEY_UNDEF_BASE - 2
  18. #endif
  19. #ifndef KEY_LEFT
  20. # define KEY_LEFT KEY_UNDEF_BASE - 3
  21. #endif
  22. #ifndef KEY_RIGHT
  23. # define KEY_RIGHT KEY_UNDEF_BASE - 4
  24. #endif
  25. #ifndef KEY_HOME
  26. # define KEY_HOME _KEY_UNDEF_BASE - 5
  27. #endif
  28. #ifndef KEY_LL
  29. # define KEY_LL KEY_UNDEF_BASE - 6
  30. #endif
  31. #ifndef KEY_PPAGE
  32. # define KEY_PPAGE KEY_UNDEF_BASE - 7
  33. #endif
  34. #ifndef KEY_NPAGE
  35. # define KEY_NPAGE KEY_UNDEF_BASE - 8
  36. #endif
  37. #ifndef KEY_ENTER
  38. # define KEY_ENTER KEY_UNDEF_BASE - 9
  39. #endif
  40. #ifndef KEY_CLEAR
  41. # define KEY_CLEAR KEY_UNDEF_BASE - 10
  42. #endif
  43. #ifndef KEY_RESIZE
  44. # define KEY_RESIZE KEY_UNDEF_BASE - 11
  45. #endif
  46. #ifndef KEY_END
  47. # define KEY_END KEY_UNDEF_BASE - 12
  48. #endif
  49. /* Always define these keys */
  50. #ifndef ESC
  51. # define ESC '\033' /* escape character */
  52. #endif
  53. #ifndef DEL
  54. # define DEL '\177' /* delete character */
  55. #endif
  56. #endif /* KEYS_H*/