void WaitForExe(){ while (IsKeyDown(KEY_CTRL_EXE) != 1) { if (IsKeyUp(KEY_CTRL_EXIT) != 1 || IsKeyUp(KEY_CTRL_MENU) != 1) { Reset_Calc(); } }}int AddIn_main(int isAppli, unsigned short OptionNum){ Bdisp_AllClr_DDVRAM(); CoolText(1, 1, FONT_FIVE, "HELLO", SDK_VRAM); Bdisp_PutDisp_DD(); WaitForExe(); Bdisp_AllClr_DDVRAM(); CoolText(1, 1, FONT_FIVE, "WORLD", SDK_VRAM); Bdisp_PutDisp_DD(); WaitForExe(); Reset_Calc(); return 0;}
Problem is, my program always runs right through the second WaitForExe without any input in the "WORLD" part, but not if I replace the WaitForExe with a different loop, like
while (IsKeyDown(KEY_CTRL_EXIT){}
The problem only occurs when I try to run IsKeyDown on the same key twice in a row. It can be any key.
I think that the functions aren't running correctly the second time, or that they're returning the same result for some reason, or perhaps the program is running too fast for the calculator to register the change in the state of the exe button. I've tried using Sleep(x) where x is 500 or 1000 or so but that always crashes the emulator for some reason. Can someone tell me what's wrong or how to fix this?
EDIT: CoolText() is a RevolutionFx function for those of you who are unfamiliar with it. But I've isolated the problem to IsKeyDown, so I know that CoolText isn't the problem.
EDIT #2: Found out that the text was being drawn so fast I couldn't let go of the exe button before it finished drawing. I added while (IsKeyUp(KEY_CTRL_EXE) != 1) {} to the end of the WaitForExe() command and now it's fixed. This thread can be deleted.
Edited by AtomicSneakers, 19 April 2011 - 10:19 PM.