X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fnode-pty%2Fdeps%2Fwinpty%2Fmisc%2FGetCh.cc;fp=node_modules%2Fnode-pty%2Fdeps%2Fwinpty%2Fmisc%2FGetCh.cc;h=cd6ed1943adbd22f87a7d0faf34aba0faa0916f6;hp=0000000000000000000000000000000000000000;hb=e79e4a5a87f3e84f7c1777f10a954453a69bf540;hpb=4339da12467b75fb8b6ca831f4bf0081c485ed2c diff --git a/node_modules/node-pty/deps/winpty/misc/GetCh.cc b/node_modules/node-pty/deps/winpty/misc/GetCh.cc new file mode 100644 index 0000000..cd6ed19 --- /dev/null +++ b/node_modules/node-pty/deps/winpty/misc/GetCh.cc @@ -0,0 +1,20 @@ +#include +#include +#include + +int main() { + printf("\nPress any keys -- Ctrl-D exits\n\n"); + + while (true) { + const int ch = getch(); + printf("0x%x", ch); + if (isgraph(ch)) { + printf(" '%c'", ch); + } + printf("\n"); + if (ch == 0x4) { // Ctrl-D + break; + } + } + return 0; +}