Content originally posted in LPCWare by kevingodfrey on Sun Jun 17 22:50:20 MST 2012
[FONT=Calibri]I would like some help with emWIN and emBOS and the keyboardmanager please.[/FONT][FONT=Calibri] [/FONT]
[FONT=Calibri]I am using GUI_SendKeyMsg() from my keyboard task when ahardware key press is detected.[/FONT]
[FONT=Calibri]I have another task that I want to use to display a graphicfor which key was pressed. [/FONT]
[FONT=Calibri] [/FONT]
[FONT=Calibri]static void _Task_0(void) {[/FONT]
[FONT=Calibri] WM_HWIN hWin; [/FONT]
[FONT=Calibri] hWin = GUI_ExecDialogBox(_aDialogCreate,GUI_COUNTOF(_aDialogCreate), &_cbCallbackT0, 0, 0, 0);[/FONT]
[FONT=Calibri] [/FONT]
[FONT=Calibri]while(1)[/FONT]
[FONT=Calibri] {[/FONT]
[FONT=Calibri] WM_SetFocus(hWin);[/FONT]
[FONT=Calibri] GUI_WaitKey();[/FONT]
[FONT=Calibri] GUI_Delay(1000);[/FONT]
[FONT=Calibri]}[/FONT]
[FONT=Calibri]}[/FONT]
[FONT=Calibri] [/FONT]
[FONT=Calibri]Within the call-back for the above dialog box I have thefollowing check for the key. I have a breakpoint set here to capture the keyevent.[/FONT]
[FONT=Calibri] [/FONT]
[FONT=Calibri]case WM_KEY:[/FONT]
[FONT=Calibri] switch (((WM_KEY_INFO*)(pMsg->Data.p))->Key)[/FONT]
[FONT=Calibri] {[/FONT]
[FONT=Calibri] case GUI_KEY_UP:[/FONT]
[FONT=Calibri] hItem =WM_GetDialogItem(pMsg->hWin, ID_IMAGE_0);[/FONT]
[FONT=Calibri] IMAGE_SetBitmap(hItem, &bmarrow_up);//GUI_EndDialog(hWin, 1);[/FONT]
[FONT=Calibri] break;[/FONT]
[FONT=Calibri] case GUI_KEY_ENTER:[/FONT]
[FONT=Calibri] GUI_EndDialog(hWin, 0);[/FONT]
[FONT=Calibri] break;[/FONT]
[FONT=Calibri] };[/FONT]
[FONT=Calibri] break;[/FONT]
[FONT=Calibri] [/FONT]
[FONT=Calibri] [/FONT]
[FONT=Calibri]My problem is that I don’t reach this breakpoint after thekey is pressed and GUI_SendKeyMsg() is called. [/FONT]
[FONT=Calibri]The way I understand this, the callback is called after theGUI_SendKeyMsg() is called, is this correct?[/FONT]