The problem I am having is that after the keypress is made it records it and doesn't process it until after the scanner scans something. I have it doing something very similar in another function that works just fine, it takes the keypress and processes it right then but for the life of me I cannot figure out why it is not working here. The code itself works, it just works wrong.
int GetScanData()
{
int readKeypad;
BOOL scKey;
BOOL scanAgain;
do{
scKey = NGS_Kbhit(); // Returns TRUE/FALSE
if(scKey == TRUE)
{
readKeypad = NGS_rKeypad(); // Gets int value of key pressed
if (readKeypad == KEY1)
{
scanAgain = FALSE;
return 0;
} else if (readKeypad == KEY2)
{
scanAgain = FALSE;
return 0;
}
}else if(scKey == FALSE)
{
NGS_rScanner(equip, 1, 0 ,0); // Collects barcode and stores it in an array
scanData[e] = str; // Add string to the array
printf("\n%s", scanData[e]);
e = e + 1;
scanAgain = TRUE;
}
}while(scanAgain == TRUE);
return 0;
}
Please tell me what I'm doing that is stupid, I know it is something stupid. :mad:


Sign In
Create Account


Back to top









