How to organize the input from the keyboard?

The program has a separate thread, where you have to enter a combination without pressing Enter. Just press 4 key and the program should shut down. How can I do that?
OS - debian
July 12th 19 at 16:54
2 answers
July 12th 19 at 16:56
Well, to count the number of characters introduced and how will 4 - make an event
July 12th 19 at 16:58

Find more questions by tags CLinux