I am making a game which has a character moves in 4 directions: up, down, left, right corresponding to W,S,A,D on the keyboard. The problem is when using getch()
to get input from buffer, it always has a pause time after the first single keypress. For instance, when I hold 'A' button, it acts like: A(a short period of time)AAAAAAAAA
.
How do I get rid of that delay time?
Any help would be appreciated.
(Answers in either C
or C++
are all acceptable, since I am using graphics.h for this program, which requires C++
to run, but I mainly code in C
).
I am using windows 10 64 bits.