adding a kbhit() function
This commit is contained in:
12
essai.c
12
essai.c
@@ -19,7 +19,7 @@ int verbosity;
|
||||
/* --------------------------------------------------------------- */
|
||||
int affiche_valeurs(int sfd, int nbloops)
|
||||
{
|
||||
int idx, foo;
|
||||
int idx, foo, key;
|
||||
char ligne[200];
|
||||
int Idatas[4];
|
||||
float Fdatas[4];
|
||||
@@ -38,8 +38,16 @@ if (NULL==fp) {
|
||||
|
||||
for (idx=0; idx<nbloops; idx++) {
|
||||
|
||||
if (kbhit()) {
|
||||
message("!!! KEY !!!");
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
foo = getline_to(sfd, ligne, 100, 0);
|
||||
if (verbosity) message(ligne);
|
||||
|
||||
if (*ligne == 'M') {
|
||||
message(ligne);
|
||||
}
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
if (foo) fprintf(stderr, "get values -> %d\n", foo);
|
||||
|
||||
Reference in New Issue
Block a user