Changeset fa09449 in mainline for uspace/srv/console/console.c
- Timestamp:
- 2009-02-15T22:31:07Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6cd9aa6
- Parents:
- 76dd25b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/console/console.c
r76dd25b rfa09449 298 298 ipc_call_t call; 299 299 int retval; 300 int c;300 kbd_event_t ev; 301 301 connection_t *conn; 302 302 int newcon; … … 320 320 retval = 0; 321 321 break; 322 case KBD_ PUSHCHAR:323 /* got key from keyboard driver*/322 case KBD_EVENT: 323 /* Got event from keyboard driver. */ 324 324 retval = 0; 325 c = IPC_GET_ARG1(call); 325 ev.type = IPC_GET_ARG1(call); 326 ev.key = IPC_GET_ARG2(call); 327 ev.mods = IPC_GET_ARG3(call); 328 ev.c = IPC_GET_ARG4(call); 329 326 330 /* switch to another virtual console */ 327 331 328 332 conn = &connections[active_console]; 329 /* 330 * if ((c >= KBD_KEY_F1) && (c < KBD_KEY_F1 + 331 * CONSOLE_COUNT)) { 332 */ 333 if ((c >= 0x101) && (c < 0x101 + CONSOLE_COUNT)) { 334 if (c == 0x112) 333 334 if ((ev.key >= 0x101) && (ev.key < 0x101 + 335 CONSOLE_COUNT)) { 336 if (ev.key == 0x112) 335 337 change_console(KERNEL_CONSOLE); 336 338 else 337 change_console( c- 0x101);339 change_console(ev.key - 0x101); 338 340 break; 339 341 } … … 342 344 if (conn->keyrequest_counter > 0) { 343 345 conn->keyrequest_counter--; 344 ipc_answer_ 1(fifo_pop(conn->keyrequests), EOK,345 c);346 ipc_answer_4(fifo_pop(conn->keyrequests), EOK, 347 ev.type, ev.key, ev.mods, ev.c); 346 348 break; 347 349 } 348 349 keybuffer_push(&conn->keybuffer, c);350 351 keybuffer_push(&conn->keybuffer, &ev); 350 352 retval = 0; 351 353 352 354 break; 353 355 default: … … 364 366 ipc_call_t call; 365 367 int consnum; 366 ipcarg_t arg1, arg2, arg3 ;368 ipcarg_t arg1, arg2, arg3, arg4; 367 369 connection_t *conn; 368 370 … … 389 391 arg1 = 0; 390 392 arg2 = 0; 393 arg3 = 0; 394 arg4 = 0; 395 391 396 switch (IPC_GET_METHOD(call)) { 392 397 case IPC_M_PHONE_HUNGUP: … … 459 464 curs_visibility(arg1); 460 465 break; 461 case CONSOLE_GET CHAR:466 case CONSOLE_GETKEY: 462 467 if (keybuffer_empty(&conn->keybuffer)) { 463 468 /* buffer is empty -> store request */ … … 475 480 continue; 476 481 } 477 int ch; 478 keybuffer_pop(&conn->keybuffer, &ch); 479 arg1 = ch; 482 kbd_event_t ev; 483 keybuffer_pop(&conn->keybuffer, &ev); 484 arg1 = ev.type; 485 arg2 = ev.key; 486 arg3 = ev.mods; 487 arg4 = ev.c; 480 488 break; 481 489 } 482 ipc_answer_ 2(callid, EOK, arg1, arg2);490 ipc_answer_4(callid, EOK, arg1, arg2, arg3, arg4); 483 491 } 484 492 }
Note:
See TracChangeset
for help on using the changeset viewer.