Skip to content

Instantly share code, notes, and snippets.

View tlorens's full-sized avatar
🏠
Working from home

Timothy Lorens tlorens

🏠
Working from home
View GitHub Profile
@tlorens
tlorens / getch.c
Created September 11, 2014 12:45
Capture single key input and continue in C
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <termios.h>
#include <stdlib.h>
static struct termios g_old_kbd_mode;
static int kbhit(void) {
struct timeval timeout;