From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 20 Nov 1997 13:04:54 -0500 From: Tad Hunt tad@csh.rit.edu Subject: [9fans] Novice use of libg Topicbox-Message-UUID: 6ba5ad48-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19971120180454.F_Z6xRxIy7ZuHv5TM-i7wmWGRr7IwGwc3NiNvsBRdE8@z> In message , you said: ;------------------------------- cut here ----------------------- ;int ;main(int argc, char **argv) { ; Mouse mouse; ; ulong Estdin; ; bool done = false; ; progname = argv[0]; ; binit(panic, 0, progname); ; if ((Estdin = estart((ulong)0, 0, 8192)) == 0) ; panic("Estdin = estart(0, 0, 8192) fails"); ; einit(Emouse | Estdin); ; do { ; struct Event e; ; ulong key = eread(Emouse | Estdin, &e); ; if (key == Estdin) { ;fprintf(stderr, "debug: Estdin, e.n %d\n", e.n); fflush(stderr); ; } else if (key == Emouse) { ;fprintf(stderr, "debug: Emouse, x %d y %d\n", e.mouse.xy.x, e.mouse.xy.y); ;fflush(stderr); ; } else ; panic("unexpected event"); ; } while (!done); I see two problems off the top of my head: eread() is only called once. done is never set to "true", thus the looping.