Changeset 5e0acaa in mainline for uspace/srv/hid/remcons/remcons.c
- Timestamp:
- 2024-10-10T11:52:43Z (21 hours ago)
- Branches:
- master
- Children:
- fb06afd
- Parents:
- 5f5d375
- git-author:
- Jiri Svoboda <jiri@…> (2024-10-09 17:46:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-10-10 11:52:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/remcons/remcons.c
r5f5d375 r5e0acaa 126 126 static void remcons_vt_flush(void *); 127 127 static void remcons_vt_key(void *, keymod_t, keycode_t, char); 128 static void remcons_vt_pos_event(void *, pos_event_t *); 128 129 129 130 static vt100_cb_t remcons_vt_cb = { … … 131 132 .control_puts = remcons_vt_cputs, 132 133 .flush = remcons_vt_flush, 133 .key = remcons_vt_key 134 .key = remcons_vt_key, 135 .pos_event = remcons_vt_pos_event 134 136 }; 135 137 … … 369 371 event->cev.ev.key.key = key; 370 372 event->cev.ev.key.c = c; 373 374 return event; 375 } 376 377 /** Creates new position event. 378 * 379 * @param ev Position event. 380 * @param c Pressed character. 381 */ 382 static remcons_event_t *new_pos_event(pos_event_t *ev) 383 { 384 remcons_event_t *event = malloc(sizeof(remcons_event_t)); 385 if (event == NULL) { 386 fprintf(stderr, "Out of memory.\n"); 387 return NULL; 388 } 389 390 link_initialize(&event->link); 391 event->cev.type = CEV_POS; 392 event->cev.ev.pos = *ev; 371 393 372 394 return event; … … 627 649 } 628 650 651 static void remcons_vt_pos_event(void *arg, pos_event_t *ev) 652 { 653 remcons_t *remcons = (remcons_t *)arg; 654 655 remcons_event_t *cev = new_pos_event(ev); 656 if (cev == NULL) 657 return; 658 659 list_append(&cev->link, &remcons->in_events); 660 } 661 629 662 /** Window size update callback. 630 663 * … … 700 733 vt100_cls(remcons->vt); 701 734 vt100_set_pos(remcons->vt, 0, 0); 735 vt100_set_button_reporting(remcons->vt, true); 702 736 } 703 737
Note:
See TracChangeset
for help on using the changeset viewer.