Changeset ebb1489 in mainline for uspace/srv/hid/console/console.c
- Timestamp:
- 2024-10-13T08:23:40Z (8 weeks ago)
- Children:
- 0472cf17
- Parents:
- 2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
- git-committer:
- GitHub <noreply@…> (2024-10-13 08:23:40)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/console.c
r2a0c827c rebb1489 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * Copyright (c) 2011 Martin Decky 4 4 * All rights reserved. … … 334 334 { 335 335 /* Got key press/release event */ 336 cons_ event_t *event =337 (cons_ event_t *) malloc(sizeof(cons_event_t));336 cons_qevent_t *event = 337 (cons_qevent_t *) malloc(sizeof(cons_qevent_t)); 338 338 if (event == NULL) 339 339 return; 340 340 341 *event= *ev;341 event->ev = *ev; 342 342 link_initialize(&event->link); 343 343 … … 366 366 { 367 367 cons_event_t event; 368 368 bool alt; 369 bool shift; 370 371 alt = (mods & KM_ALT) != 0 && (mods & (KM_CTRL | KM_SHIFT)) == 0; 372 shift = (mods & KM_SHIFT) != 0 && (mods & (KM_CTRL | KM_ALT)) == 0; 373 374 /* Switch console on Alt+Fn or Shift+Fn */ 369 375 if ((key >= KC_F1) && (key <= KC_F1 + CONSOLE_COUNT) && 370 ( (mods & KM_CTRL) == 0)) {376 (alt || shift)) { 371 377 cons_switch(key - KC_F1); 372 378 } else { … … 550 556 if (pos < size) { 551 557 link_t *link = prodcons_consume(&cons->input_pc); 552 cons_event_t *event = list_get_instance(link, 553 cons_event_t, link); 558 cons_qevent_t *qevent = list_get_instance(link, 559 cons_qevent_t, link); 560 cons_event_t *event = &qevent->ev; 554 561 555 562 /* Accept key presses of printable chars only. */ … … 561 568 } 562 569 563 free( event);570 free(qevent); 564 571 } 565 572 } … … 697 704 console_t *cons = srv_to_console(srv); 698 705 link_t *link = prodcons_consume(&cons->input_pc); 699 cons_ event_t *cevent = list_get_instance(link, cons_event_t, link);700 701 *event = *cevent;702 free( cevent);706 cons_qevent_t *qevent = list_get_instance(link, cons_qevent_t, link); 707 708 *event = qevent->ev; 709 free(qevent); 703 710 return EOK; 704 711 }
Note:
See TracChangeset
for help on using the changeset viewer.