lv_indev.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /**
  2. * @file lv_indev_proc.h
  3. *
  4. */
  5. #ifndef LV_INDEV_H
  6. #define LV_INDEV_H
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. /*********************
  11. * INCLUDES
  12. *********************/
  13. #include "lv_obj.h"
  14. #include "../lv_hal/lv_hal_indev.h"
  15. #include "../lv_core/lv_group.h"
  16. /*********************
  17. * DEFINES
  18. *********************/
  19. /**********************
  20. * TYPEDEFS
  21. **********************/
  22. /**********************
  23. * GLOBAL PROTOTYPES
  24. **********************/
  25. /**
  26. * Initialize the display input device subsystem
  27. */
  28. void lv_indev_init(void);
  29. /**
  30. * Get the currently processed input device. Can be used in action functions too.
  31. * @return pointer to the currently processed input device or NULL if no input device processing right now
  32. */
  33. lv_indev_t * lv_indev_get_act(void);
  34. /**
  35. * Reset one or all input devices
  36. * @param indev pointer to an input device to reset or NULL to reset all of them
  37. */
  38. void lv_indev_reset(lv_indev_t * indev);
  39. /**
  40. * Reset the long press state of an input device
  41. * @param indev_proc pointer to an input device
  42. */
  43. void lv_indev_reset_lpr(lv_indev_t * indev);
  44. /**
  45. * Enable input devices device by type
  46. * @param type Input device type
  47. * @param enable true: enable this type; false: disable this type
  48. */
  49. void lv_indev_enable(lv_hal_indev_type_t type, bool enable);
  50. /**
  51. * Set a cursor for a pointer input device (for LV_INPUT_TYPE_POINTER and LV_INPUT_TYPE_BUTTON)
  52. * @param indev pointer to an input device
  53. * @param cur_obj pointer to an object to be used as cursor
  54. */
  55. void lv_indev_set_cursor(lv_indev_t *indev, lv_obj_t *cur_obj);
  56. #if USE_LV_GROUP
  57. /**
  58. * Set a destination group for a keypad input device (for LV_INDEV_TYPE_KEYPAD)
  59. * @param indev pointer to an input device
  60. * @param group point to a group
  61. */
  62. void lv_indev_set_group(lv_indev_t *indev, lv_group_t *group);
  63. #endif
  64. /**
  65. * Set the an array of points for LV_INDEV_TYPE_BUTTON.
  66. * These points will be assigned to the buttons to press a specific point on the screen
  67. * @param indev pointer to an input device
  68. * @param group point to a group
  69. */
  70. void lv_indev_set_button_points(lv_indev_t *indev, lv_point_t *points);
  71. /**
  72. * Get the last point of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
  73. * @param indev pointer to an input device
  74. * @param point pointer to a point to store the result
  75. */
  76. void lv_indev_get_point(lv_indev_t * indev, lv_point_t * point);
  77. /**
  78. * Check if there is dragging with an input device or not (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
  79. * @param indev pointer to an input device
  80. * @return true: drag is in progress
  81. */
  82. bool lv_indev_is_dragging(lv_indev_t * indev);
  83. /**
  84. * Get the vector of dragging of an input device (for LV_INDEV_TYPE_POINTER and LV_INDEV_TYPE_BUTTON)
  85. * @param indev pointer to an input device
  86. * @param point pointer to a point to store the vector
  87. */
  88. void lv_indev_get_vect(lv_indev_t * indev, lv_point_t * point);
  89. /**
  90. * Get elapsed time since last press
  91. * @param indev pointer to an input device (NULL to get the overall smallest inactivity)
  92. * @return Elapsed ticks (milliseconds) since last press
  93. */
  94. uint32_t lv_indev_get_inactive_time(lv_indev_t * indev);
  95. /**
  96. * Do nothing until the next release
  97. * @param indev pointer to an input device
  98. */
  99. void lv_indev_wait_release(lv_indev_t * indev);
  100. /**********************
  101. * MACROS
  102. **********************/
  103. #ifdef __cplusplus
  104. } /* extern "C" */
  105. #endif
  106. #endif /*LV_INDEV_H*/