DEV Community

Dobby33
Dobby33

Posted on

Answer: C non-blocking keyboard input

As already stated, you can use sigaction to trap ctrl-c, or select to trap any standard input.

Note however that with the latter method you also need to set the TTY so that it's in character-at-a-time rather than line-at-a-time mode. The latter is the default - if you type in…

Top comments (2)

Collapse
 
dobby33 profile image
Dobby33

CC BY-SA 4.0

Collapse
 
dobby33 profile image
Dobby33