|
最近在做手写输入法,编写了一个触摸屏的伪驱动来截获全屏手写的书写笔迹。但是遇到点问题。因为很多时候触摸屏上的单击是必须的,我要把单击桌面图标的消息发给系统,其它的发给我的输入法窗口。下面是我的程序,在消息的的分发上还是存在问题,我是把所有的单击都发给系统了,这个显然是不可以的。手写时落笔也是单击,次单击消息应该是发给我的输入法窗口的。这个问题不知道怎么解决,望高手指点! // down
if(Flags == (TouchSampleDownFlag | TouchSampleIsCalibratedFlag | TouchSampleValidFlag))
{
xSaved = X;
ySaved = Y;
flag_up=0;
return pfnOrgTouchPanelCallback(Flags, X,Y);
}
// mouse
else if(Flags == (TouchSampleDownFlag | TouchSamplePreviousDownFlag | TouchSampleIsCalibratedFlag |
TouchSampleValidFlag))
{
if(abs(X- xSaved)>4 && abs(Y- ySaved)>4)
{ flag_up=1;
SendMessage(g_hwWnd, WM_MOUSEMOVE, 0, MAKELPARAM(X,Y));
xSaved = X;
ySaved = Y;
flag_down=1;}
if(flag_down==1)
{flag_up=1;
SendMessage(g_hwWnd, WM_MOUSEMOVE, 0, MAKELPARAM(X,Y));}
else
{flag_up=0;
return pfnOrgTouchPanelCallback(Flags, X,Y);
}
}
//}// up
else if(Flags ==(TouchSampleIsCalibratedFlag |
TouchSampleValidFlag | TouchSamplePreviousDownFlag))
{if(flag_up==1)
SendMessage(g_hwWnd, WM_LBUTTONUP, 0, MAKELPARAM(X,Y));
else return pfnOrgTouchPanelCallback(Flags, X,Y);
}
else
{flag_down=1;
return pfnOrgTouchPanelCallback(Flags, X,Y);
}
|
|