I have this function that gets one character input in the terminal without the user having to press Enter. I can detect ALT + another key by checking for '\033' (escape), but how do I check if user pressed CTRL + another key?
int getch() {
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
newt = oldt;
newt.c_lflag &= ~(ICANON | ECHO);
tcsetattr(STDIN_FILENO, TCSANOW, &newt);
ch = getc(stdin);
tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
return ch;
}