Lines Matching +full:rotation +full:- +full:input +full:- +full:code

4  * SPDX-License-Identifier: Apache-2.0
33 const struct lvgl_pointer_input_config *cfg = dev->config; in lvgl_pointer_process_event()
34 struct lvgl_pointer_input_data *data = dev->data; in lvgl_pointer_process_event()
37 struct display_capabilities *cap = &disp_data->cap; in lvgl_pointer_process_event()
38 lv_point_t *point = &data->common_data.pending_event.point; in lvgl_pointer_process_event()
40 switch (evt->code) { in lvgl_pointer_process_event()
42 if (cfg->swap_xy) { in lvgl_pointer_process_event()
43 data->point_y = evt->value; in lvgl_pointer_process_event()
45 data->point_x = evt->value; in lvgl_pointer_process_event()
49 if (cfg->swap_xy) { in lvgl_pointer_process_event()
50 data->point_x = evt->value; in lvgl_pointer_process_event()
52 data->point_y = evt->value; in lvgl_pointer_process_event()
56 data->common_data.pending_event.state = in lvgl_pointer_process_event()
57 evt->value ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; in lvgl_pointer_process_event()
61 if (!evt->sync) { in lvgl_pointer_process_event()
66 .x = data->point_x, in lvgl_pointer_process_event()
67 .y = data->point_y, in lvgl_pointer_process_event()
70 if (cfg->invert_x) { in lvgl_pointer_process_event()
71 if (cap->current_orientation == DISPLAY_ORIENTATION_NORMAL || in lvgl_pointer_process_event()
72 cap->current_orientation == DISPLAY_ORIENTATION_ROTATED_180) { in lvgl_pointer_process_event()
73 tmp_point.x = cap->x_resolution - tmp_point.x; in lvgl_pointer_process_event()
75 tmp_point.x = cap->y_resolution - tmp_point.x; in lvgl_pointer_process_event()
79 if (cfg->invert_y) { in lvgl_pointer_process_event()
80 if (cap->current_orientation == DISPLAY_ORIENTATION_NORMAL || in lvgl_pointer_process_event()
81 cap->current_orientation == DISPLAY_ORIENTATION_ROTATED_180) { in lvgl_pointer_process_event()
82 tmp_point.y = cap->y_resolution - tmp_point.y; in lvgl_pointer_process_event()
84 tmp_point.y = cap->x_resolution - tmp_point.y; in lvgl_pointer_process_event()
88 /* rotate touch point to match display rotation */ in lvgl_pointer_process_event()
89 switch (cap->current_orientation) { in lvgl_pointer_process_event()
91 point->x = tmp_point.x; in lvgl_pointer_process_event()
92 point->y = tmp_point.y; in lvgl_pointer_process_event()
95 point->x = tmp_point.y; in lvgl_pointer_process_event()
96 point->y = cap->y_resolution - tmp_point.x; in lvgl_pointer_process_event()
99 point->x = cap->x_resolution - tmp_point.x; in lvgl_pointer_process_event()
100 point->y = cap->y_resolution - tmp_point.y; in lvgl_pointer_process_event()
103 point->x = cap->x_resolution - tmp_point.y; in lvgl_pointer_process_event()
104 point->y = tmp_point.x; in lvgl_pointer_process_event()
112 if (point->x <= 0) { in lvgl_pointer_process_event()
113 point->x = 0; in lvgl_pointer_process_event()
114 } else if (point->x >= cap->x_resolution) { in lvgl_pointer_process_event()
115 point->x = cap->x_resolution - 1; in lvgl_pointer_process_event()
118 if (point->y <= 0) { in lvgl_pointer_process_event()
119 point->y = 0; in lvgl_pointer_process_event()
120 } else if (point->y >= cap->y_resolution) { in lvgl_pointer_process_event()
121 point->y = cap->y_resolution - 1; in lvgl_pointer_process_event()
124 if (k_msgq_put(cfg->common_config.event_msgq, &data->common_data.pending_event, in lvgl_pointer_process_event()
126 LOG_WRN("Could not put input data into queue"); in lvgl_pointer_process_event()