summaryrefslogtreecommitdiff
path: root/c/key.c
diff options
context:
space:
mode:
authorpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
committerpants <niklasjo2004@gmail.com>2026-09-21 14:17:03 -0700
commit7b21727285e50b0b050c4ddd70d07542229c5366 (patch)
tree5d369153c5df5b41f3750d25479a68f20169c8ff /c/key.c
init
Diffstat (limited to 'c/key.c')
-rw-r--r--c/key.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/c/key.c b/c/key.c
new file mode 100644
index 0000000..74379f6
--- /dev/null
+++ b/c/key.c
@@ -0,0 +1,18 @@
+#include <ncurses.h>
+int main() {
+ initscr();
+ cbreak();
+ noecho();
+
+ printw("press h to do something, and q to quit.\n");
+
+ int ch;
+ while ((ch = getch()) != 'q') {
+ if (ch == 'h') {
+ printw("yep thats h\n");
+ }
+ }
+
+ endwin();
+ return 0;
+}