57,7 → 57,9 |
#include "tetris.h" |
|
#include <async.h> |
#include "../../srv/console/console.h" |
#include <ipc/console.h> |
#include <console.h> |
#include <kbd/kbd.h> |
|
/* return true iff the given timeval is positive */ |
#define TV_POS(tv) \ |
111,10 → 113,11 |
s = NULL; |
|
if (!lastchar) { |
again: |
if (!getchar_inprog) { |
cons_phone = get_cons_phone(); |
cons_phone = console_open(true); |
getchar_inprog = async_send_2(cons_phone, |
CONSOLE_GETCHAR, 0, 0, &charcall); |
CONSOLE_GETKEY, 0, 0, &charcall); |
} |
if (!s) |
async_wait_for(getchar_inprog, &rc); |
127,7 → 130,10 |
if (rc) { |
stop("end of file, help"); |
} |
lastchar = IPC_GET_ARG1(charcall); |
if (IPC_GET_ARG1(charcall) == KE_RELEASE) |
goto again; |
|
lastchar = IPC_GET_ARG4(charcall); |
} |
if (tvp) { |
/* since there is input, we may not have timed out */ |