#include #include #include #include #include "typer.h" #include "vimtyper.h" #include "keyhandler.h" #include "humanizerkeyhandler.h" #include "xkeyhandler.h" using namespace std; static std::unique_ptr typer; void onInterrupted(int) { if (typer) { typer->TogglePaused(); } } int main(int argc, char** argv) { if (argc < 2) { cout << "Usage: " << argv[0] << ""; return 1; } signal(SIGINT, onInterrupted); printf("Get ready!\n"); for (int i = 10; i >= 0; i--) { printf("\rStarting in %d seconds...", i); fflush(stdout); sleep(1); } printf("\n"); std::unique_ptr keyHandler(new XKeyHandler()); std::unique_ptr humanizer(new HumanizerKeyHandler(std::move(keyHandler))); typer.reset(new VimTyper(std::move(humanizer))); typer->ProcessFile(argv[1]); return 0; }