Skip to content

Instantly share code, notes, and snippets.

@tmathmeyer
Created March 8, 2014 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmathmeyer/9425380 to your computer and use it in GitHub Desktop.
Save tmathmeyer/9425380 to your computer and use it in GitHub Desktop.
pthread_t sysinthread;
pthread_create(&sysinthread, NULL, sysin, NULL);
while(!running)
{
usleep(100000);
}
while(running)
{
update_screen();
usleep(10);
}
return 0;
}
void* sysin(void* arg)
{
XEvent evt;
while(1);
{
XNextEvent(dsp, &evt);
if (evt.type == KeyPress)
{
screen[cursor++] = scribble;
running = 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment