Hello
This seems to be happening becuase the OGL control has focus and not the panel. When you click on the OGL panel, it gets focus and since it cannot process key press events ( since its an indicator and indicators dont usually recieve key presses),ESC is ignore. The panel has to have focus in order to get the key press. You can use the InstallWinMsgCallback() function ( found in the Programmers toolbox ( under ../CVI/toolslib/toolbox folder) to process all the key presses that CVI recieve for a particular panel. Then check for the escape key to reset the OGL control.
//Install callback
InstallWinMsgCallback(panel,WM_KEYUP,MyCallback,VAL_MODE_IN_QUEUE,NULL,&handle);
//Handle escape in the callback
int CVICALLBACK MyCallback (int panelHandle, int m
essage,
unsigned int* wParam, unsigned int* lParam,
void* callbackData)
{
if(*wParam == VK_ESCAPE){
OpenglFrameResize(1); }
return 0;
}
Dont forget to uninstall the winmsg callback by calling RemoveWinMsgCallback(). You will also need to include the windows.h header as the very first header in your list of includes.
Hope this helps
Bilal Durrani
NI
Bilal Durrani
NI