So i've finally gotten around to learning to make add-ins for my fx-9860gii and i'm having a little bit of trouble getting the functionality I want.
What I'm trying to do is write a function that will repeat constantly, but once the menu key is pressed the main menu opens up. my first thought was..
unsigned int key; while(1) { GetKey(&key); if(key!=KEY_CTRL_MENU) { //loop code } }
but then I found that this won't work because the GetKey() command halts the program and so it doesn't continue the loop unless a key is pressed.
eventually I came across the BKey_GetKeyWait() and the documentation says that it has the functionality I'm looking for. If I was to write..
unsigned int kcode1,kcode2; short unused; while(1) { Bkey_GetKeyWait(&kcode1, &kcode2, KEYWAIT_HALTOFF_TIMEROFF, 0, 0, &unused); //loop code }
Then since I'm using KEYWAIT_HALTOFF_TIMEROFF the program wont halt anymore and will continuously run the loop code. Whats more, since the fifth input is 0 the documentation says that the function will open up the menu rather than return the keycode when the menu button is pressed.
This isn't the case however, the calculator runs the loop and doesn't go to the main menu when the button is pressed.
does anyone know how to get the functionality I want or can at least tell me what I'm doing wrong?