home *** CD-ROM | disk | FTP | other *** search
- /* ***************************************************************************
-
- events.c - event handling routine
-
- Functions: proc_event()
-
- Date: 8/5/92
-
- Copyright (c) 1992 Alan Richardson
-
- ************************************************************************ */
-
-
- #include "all.h"
-
- void proc_event();
-
- /* event handling routine */
- void proc_event()
- {
- XEvent ev;
- int expflag=0;
-
- /* loop through any queued events ... */
- while (XPending(dpy)!=0)
- {
- XNextEvent(dpy,&ev);
-
- switch(ev.type)
- {
- /* expose event means redraw the screen ... */
- case Expose:
- /* we try to prevent multiple consecutive redraws ... */
- if (!expflag++) XClearWindow(dpy, gowin);
- break;
-
- /* a key was pressed ... */
- case KeyPress:
- { char buf[128];
- char *blank=" ";
- KeySym ks;
- XComposeStatus status;
-
- strcpy(buf, blank);
- XLookupString(&ev, buf, 128, &ks, &status);
-
- if (buf[0]=='q') exit();
- }
- break;
-
- default:
- break;
- }
-
- }
- }
-
-
-