diff options
| author | Preston Pan <preston@nullring.xyz> | 2023-02-06 01:10:38 -0800 |
|---|---|---|
| committer | Preston Pan <preston@nullring.xyz> | 2023-02-06 01:10:38 -0800 |
| commit | 49179e6f7e9dacc8ec6d6165f72e5ed62ec0b0d0 (patch) | |
| tree | 18a581f539caae19a554ca6d36c2a1c434a55d4e /conio.h | |
| parent | 0e1eed88f1adf24923d03c120186f131dbc020fd (diff) | |
idk what I added but i added something
Diffstat (limited to 'conio.h')
| -rw-r--r-- | conio.h | 18 |
1 files changed, 4 insertions, 14 deletions
@@ -1,14 +1,4 @@ -#include <termios.h> -#include <unistd.h> -#include <stdio.h> -int getch(void) { - struct termios oldattr, newattr; - int ch; - tcgetattr(STDIN_FILENO, &oldattr); - newattr = oldattr; - newattr.c_lflag &= ~(ICANON | ECHO); - tcsetattr(STDIN_FILENO, TCSANOW, &newattr); - ch = getchar(); - tcsetattr(STDIN_FILENO, TCSANOW, &oldattr); - return ch; -} +#ifndef CONIO_H +#define CONIO_H +int getch(void); +#endif |
