From 42902a9521573ecf2ba76e3ec8a13af1a55abcb7 Mon Sep 17 00:00:00 2001 From: "R. Eric Wheeler" Date: Mon, 22 Feb 2021 23:30:14 +0000 Subject: [PATCH] Update README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..0ae2dca --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Getch for linux + +This is an attempt at replicating the non standard _getch function for windows from conio.h on linux + +It should work mostly the same as the windows function. + +For special keys you need to call _getch twice. The first time it will return either a 0 or 0xE0 (224) depending on the key pressed. + +See https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/getch-getwch?view=msvc-160#remarks + +Difference is that _getch will read CTRL+C, or any control characters. + +### Note +Make sure that the user calling the function is in the group "input" + +Only tested on Gentoo with XTerm and /dev/tty?. + +