目前按键识别没问题,不知道怎么加入消息队列中处理
离线
case MSG_TIMER:
if(wParam == _ID_TIMER)
{
//hdc=GetClientDC(hWnd);
SelectFont(hdc,logfont_rbf_gb16_song);;
SetBkColor (hdc, PIXEL_black );
SetBkMode( hdc,BM_TRANSPARENT);
SetTextColor (hdc, PIXEL_lightwhite);
SetDlgItemText (hWnd, _ID_TIME_STATIC, GetTime (psTime));
SetDlgItemText (hWnd, _ID_DATE_STATIC, GetDate(psDate));
int keys_fd;
struct input_event key_event;
keys_fd = open(DEV_PATH, O_RDONLY);
if(keys_fd <= 0)
{
printf("open /dev/input/event0 device error!\n");
return -1;
}
else
printf("open /dev/input/event0 device successfuly.\n");
if(read(keys_fd, &key_event, sizeof(key_event))==sizeof(key_event))
{
if(key_event.type==EV_KEY && key_event.value==EV_PRESS)
{
printf("\ntplayerdemo_key#");
switch(key_event.code)
{
case VOL_UP:
tplayer_setvolume(20);
break;
case VOL_DOWN:
tplayer_setvolume(0);
break;
default: break;
}
}
}
//ReleaseDC(hdc);
}
在定时器中加了按键识别,read调用是会阻塞吗
离线
有人知道静态框的字体颜色怎么改吗
离线