How to detect if user press [control + D]
I m writing a shell. The shell has to print " > " all over the time.
I m trying to implement a new command -> [control + d]
When the user press [control] buttom [+]and [D]buttom
The shell should quit
Here is the sudo code
int user_press_control_D = 0;
while(user_press_control_D == 0){
running();
detect(user_input);
if user_input == (Control + D){
user_press_control_D = 1; //quit
}
}
How to actually write / detect / check that user press (Control + D)