I was trying to convert Touch input to mouse input. But now I have a strange problem, the ShowCursor function works randomly.
here is part of my code
case ETouchMove:
if (mInMove)
{
int X = Point->Move.X;
int Y = Point->Move.Y;
mCursor.X = ((mCursorBak.X + mSpeed*X) < GetSystemMetrics(SM_CXSCREEN)
&& (mCursorBak.X + mSpeed*X) >0)
? mCursorBak.X + mSpeed*X : 0;
mCursor.Y = ((mCursorBak.Y + mSpeed*Y) < GetSystemMetrics(SM_CXSCREEN)
&& (mCursorBak.Y + mSpeed*Y) >0)
? mCursorBak.Y + mSpeed*Y : 0;
SetCursorPos(mCursor.X, mCursor.Y);
SetPhysicalCursorPos(mCursor.X, mCursor.Y);
ShowCursor(true);
}
break;
It sometime works, but most time the cursor just won't show up during moving. I saw that on MSDN page someone said that this function only works on window created by the same thread. However after trying seems no difference.
It seems I keep receiving CURSOR_SUPPRESSED which is new in win8. Is there anyway to unsuppressed since it sometime still works? I also searched through stackoverflow but seems no answers yet, could anyone give some tips?Thanks in advance.
working on a tablet without mouse win8.1 visual studio 2013