Agnius Vasiliauskas Agnius Vasiliauskas - 1 year ago 356
Linux Question

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 ?


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download