Check if any key is pressed in Linux

In case you would to know if a key (any key) is pressed in Windows it exist a very useful function called _kbhit() . Linux doesn't have a similar function but is possible to easily reproduce using a few lines of code. Nothing new since this kind of code is possible to find in many places around, it's just to give my little contribution by providing a ready made function to simply copy and past in your code.