Skip to content

Instantly share code, notes, and snippets.

@darealshinji
darealshinji / kbhit.c
Created Jul 7, 2017 — forked from vsajip/kbhit.c
Keyboard hit testing
View kbhit.c
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
int kbhit(void)
{
struct termios oldt, newt;
int ch;
int oldf;