This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <cstring> | |
#include <iostream> | |
#include <exception> | |
// Uiltities | |
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <thread> | |
#include <mutex> | |
#include <atomic> | |
#include <condition_variable> | |
// Will handle the looped excecution of a function (cycle). Add this class | |
// to the group of parent classes to the class you'd like to use it on and | |
// implement the virtual void cycle() function with your loop data. Then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// clicker.c | |
// Count the times each key has been pressed | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <termios.h> | |
// Yeah, I'm lazy, get over it | |
#define roe(_expr) if((ret = (_expr)) < 0) return ret | |
// Make sure we read stdin one key at the time |