Changeset fa09449 in mainline for uspace/lib/libc/generic/io/stream.c


Ignore:
Timestamp:
2009-02-15T22:31:07Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6cd9aa6
Parents:
76dd25b
Message:

Keycodes, keyboard events, kbd_event_get(). Keyboard driver now (formally) produces kbd events (press/release, keycode, mods, char) instead of just characters. In reality, the driver and client are only hacked to work with the new interface atm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/io/stream.c

    r76dd25b rfa09449  
    4444#include <ipc/services.h>
    4545#include <ipc/console.h>
     46#include <kbd/kbd.h>
    4647#include <unistd.h>
    4748#include <async.h>
     
    5960        open_console();
    6061        if (console_phone >= 0) {
    61                 ipcarg_t r0, r1;
     62                kbd_event_t ev;
     63                int rc;
    6264                size_t i = 0;
    6365       
    6466                while (i < count) {
    65                         if (async_req_0_2(console_phone, CONSOLE_GETCHAR, &r0, &r1) < 0)
    66                                 return -1;
    67                         ((char *) buf)[i++] = r0;
     67                        do {
     68                                rc = kbd_get_event(&ev);
     69                                if (rc < 0) return -1;
     70                        } while (ev.c == 0);
     71
     72                        ((char *) buf)[i++] = ev.c;
    6873                }
    6974                return i;
Note: See TracChangeset for help on using the changeset viewer.