What's a good getkey function to use?

0 votes
asked Jul 14 by ZX228 (390 points)

1 Answer

+1 vote
answered Jul 14 by Peter Minarik (7,160 points)
selected Jul 27 by ZX228
Best answer

What language are we talking about (Online GDB supports multiple languages).

If it's C, have a look at this: https://stackoverflow.com/questions/20349585/c-library-function-to-check-the-keypress-from-keyboard-in-linux

Most of the time, this is done via some platform-dependent library as the C standard doesn't have a proper key hit detection defined (the closest one is reading one character --getchar --  from the stdin)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.