Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Linux Shell Game Input

Name: Squeezy !31sNfzlFrg 2010-10-08 15:40

I'm writing a simple Linux Game in C++ for school, I've been using getch for my input controls for Up Down Left Right. The problem is that getch blocks the program from continuing. Online I gathered that kbhit may be a better option, except there are over 10 different kbhit.h's and they dont fucking work. if(getch) in a while(1) loop would be totally fucking fine if i could have like a 1ms timeout for getch so if there is no key pressed the screen keeps going. What do?

Name: Anonymous 2010-10-10 5:12

>>25
do you think reading from stdin isn't well-tested, doesn't work practically everywhere, isn't installed practically everywhere, and has any need at all for ecma-48 control codes? if you do, then you're retarded

protip: all you need is the read syscall, which is like one line in language

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List