Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux analog to windows GetAsyncKeyState()

Is there some Linux analog of windows function GetAsyncKeyState() ? Or maybe there exists some asynchronous function which returns - Does keyboard buffer empty or not ?

Thanks.

like image 805
Agnius Vasiliauskas Avatar asked Oct 04 '11 08:10

Agnius Vasiliauskas


1 Answers

The key question here is: For which abstraction? X windows, ncurses or stdio? Linux isn't as simple and monolithic as Windows is.

For stdio (plain old stdin/stdout text program) fgetc_unlocked does the trick.

like image 65
thiton Avatar answered Nov 17 '22 01:11

thiton