Skip to content

Instantly share code, notes, and snippets.

@rprichard
rprichard / showkey.cc
Created June 3, 2016 10:06
Single-file implementation of `showkey -a` for showing terminal input bytes
// Compile with g++ showkey.cc -o showkey
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
static inline char decodeUnixCtrlChar(char ch) {