Computer Science Canada _getch problem with unbuffered values |
Author: | copthesaint [ Thu Oct 04, 2012 4:24 pm ] | ||
Post subject: | _getch problem with unbuffered values | ||
I am trying to use _getch in C++ using window 7 visual studio 2010. The issue I am having is when I press any character after the up or down key, every other character acts the same as the last pressed up or down. Here is my code:
Any help is appreciated. thanks. |
Author: | 2goto1 [ Thu Oct 04, 2012 6:37 pm ] |
Post subject: | RE:_getch problem with unbuffered values |
In your source code, under what condition are you setting a value for inputVal? |
Author: | copthesaint [ Thu Oct 04, 2012 8:32 pm ] | ||
Post subject: | Re: _getch problem with unbuffered values | ||
2goto1 wrote: In your source code, under what condition are you setting a value for inputVal? I solved that issue moving inputVal = 0 after the switch statement, thanks for making me focus on that. It was just something simple and stupid lol.
My question now is "why wont my program terminate?" whenever I run my program the inputVal is only changed for the two arrow keys, It will not change to values 2 and 3. EDIT: never mind, enter and esc don't seem to have pressed and release states. |
Author: | QuantumPhysics [ Mon Oct 08, 2012 1:05 am ] |
Post subject: | RE:_getch problem with unbuffered values |
Are you asking why your program doesn't stop when you hit esc or are you asking why the runtime console won't close? |
Author: | copthesaint [ Mon Oct 08, 2012 6:27 pm ] |
Post subject: | RE:_getch problem with unbuffered values |
No I am not, I already solved this thread. "EDIT: never mind, enter and esc don't seem to have pressed and release states." |