Changeset 1388f7f0 in mainline for uspace/srv
- Timestamp:
- 2020-02-21T10:50:48Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 265989d
- Parents:
- 6c2aba3
- git-author:
- Jiri Svoboda <jiri@…> (2020-02-19 19:38:03)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-02-21 10:50:48)
- Location:
- uspace/srv/hid/display
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/input.c
r6c2aba3 r1388f7f0 97 97 unsigned max_x, unsigned max_y) 98 98 { 99 printf("ds_input_ev_abs_move x=%u y=%u mx=%u my=%u\n", 100 x, y, max_x, max_y); 101 return EOK; 99 ds_display_t *disp = (ds_display_t *) input->user; 100 ptd_event_t event; 101 102 event.type = PTD_ABS_MOVE; 103 event.apos.x = x; 104 event.apos.y = y; 105 event.abounds.p0.x = 0; 106 event.abounds.p0.y = 0; 107 event.abounds.p1.x = max_x + 1; 108 event.abounds.p1.y = max_y + 1; 109 110 return ds_display_post_ptd_event(disp, &event); 102 111 } 103 112 -
uspace/srv/hid/display/seat.c
r6c2aba3 r1388f7f0 256 256 * @return EOK on success or an error code 257 257 */ 258 #include <stdio.h> 258 259 errno_t ds_seat_post_ptd_event(ds_seat_t *seat, ptd_event_t *event) 259 260 { … … 306 307 } 307 308 309 if (event->type == PTD_ABS_MOVE) { 310 /* 311 * Project input device area onto display area. Technically 312 * we probably want to project onto the area of a particular 313 * display device. The tricky part is figuring out which 314 * display device the input device is associated with. 315 */ 316 gfx_coord2_project(&event->apos, &event->abounds, 317 &disp->rect, &npos); 318 319 gfx_coord2_clip(&npos, &disp->rect, &npos); 320 321 (void) ds_seat_clear_pointer(seat); 322 seat->pntpos = npos; 323 324 pevent.pos_id = 0; 325 pevent.type = POS_UPDATE; 326 pevent.btn_num = 0; 327 pevent.hpos = seat->pntpos.x; 328 pevent.vpos = seat->pntpos.y; 329 330 rc = ds_seat_post_pos_event(seat, &pevent); 331 if (rc != EOK) 332 return rc; 333 334 (void) ds_seat_draw_pointer(seat); 335 } 336 308 337 return EOK; 309 338 } -
uspace/srv/hid/display/types/display/ptd_event.h
r6c2aba3 r1388f7f0 40 40 typedef enum { 41 41 PTD_MOVE, 42 PTD_ABS_MOVE, 42 43 PTD_PRESS, 43 44 PTD_RELEASE … … 51 52 /** Relative move vector for PTD_MOVE */ 52 53 gfx_coord2_t dmove; 54 /** Absolute position for PTD_ABS_MOVE */ 55 gfx_coord2_t apos; 56 /** Absolute position bounds for PTD_ABS_MOVE */ 57 gfx_rect_t abounds; 53 58 } ptd_event_t; 54 59
Note:
See TracChangeset
for help on using the changeset viewer.