
-----------------------------------
copthesaint
Thu Oct 04, 2012 4:24 pm

_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: 


#include 
#include 
#include  
#include  

using namespace std;

int mainMenu (void){

	/*menu dependand varibles*/
	bool terminate = 0;
	const int menuEvents = 4;
	const int menuEventChr 

Any help is appreciated. thanks.

-----------------------------------
2goto1
Thu Oct 04, 2012 6:37 pm

RE:_getch problem with unbuffered values
-----------------------------------
In your source code, under what condition are you setting a value for inputVal?

-----------------------------------
copthesaint
Thu Oct 04, 2012 8:32 pm

Re: _getch problem with unbuffered values
-----------------------------------

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.

/*Checks for key events*/ 
                //inputVal = 0; 
                ch = _getch (); 
                if (ch == 0 || ch == 224){ 

                        ch = _getch (); 
                        inputVal = 0;  //