Changes in uspace/srv/hid/console/console.c [e273e9e:a635535] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/console/console.c
re273e9e ra635535 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2023 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_ qevent_t *event =337 (cons_ qevent_t *) malloc(sizeof(cons_qevent_t));336 cons_event_t *event = 337 (cons_event_t *) malloc(sizeof(cons_event_t)); 338 338 if (event == NULL) 339 339 return; 340 340 341 event->ev= *ev;341 *event = *ev; 342 342 link_initialize(&event->link); 343 343 … … 366 366 { 367 367 cons_event_t event; 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 */ 368 375 369 if ((key >= KC_F1) && (key <= KC_F1 + CONSOLE_COUNT) && 376 ( alt || shift)) {370 ((mods & KM_CTRL) == 0)) { 377 371 cons_switch(key - KC_F1); 378 372 } else { … … 556 550 if (pos < size) { 557 551 link_t *link = prodcons_consume(&cons->input_pc); 558 cons_qevent_t *qevent = list_get_instance(link, 559 cons_qevent_t, link); 560 cons_event_t *event = &qevent->ev; 552 cons_event_t *event = list_get_instance(link, 553 cons_event_t, link); 561 554 562 555 /* Accept key presses of printable chars only. */ … … 568 561 } 569 562 570 free( qevent);563 free(event); 571 564 } 572 565 } … … 704 697 console_t *cons = srv_to_console(srv); 705 698 link_t *link = prodcons_consume(&cons->input_pc); 706 cons_ qevent_t *qevent = list_get_instance(link, cons_qevent_t, link);707 708 *event = qevent->ev;709 free( qevent);699 cons_event_t *cevent = list_get_instance(link, cons_event_t, link); 700 701 *event = *cevent; 702 free(cevent); 710 703 return EOK; 711 704 }
Note:
See TracChangeset
for help on using the changeset viewer.