get Ink pen data like pressure, buttons
This commit is contained in:
@@ -516,7 +516,7 @@ int main()
|
||||
wglDeleteContext(hRC);
|
||||
DestroyWindow(hWnd);
|
||||
|
||||
hWnd = CreateWindow(wc.lpszClassName, L"UI Layout Engine - OpenGL 3.1", WS_OVERLAPPEDWINDOW,
|
||||
hWnd = CreateWindow(wc.lpszClassName, L"PanoPainter 0.1.2 alpha - OpenGL 3.1", WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, clientRect.right - clientRect.left,
|
||||
clientRect.bottom - clientRect.top, 0, 0, hInst, 0);
|
||||
|
||||
@@ -617,8 +617,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
|
||||
break;
|
||||
case WM_POINTERUPDATE:
|
||||
{
|
||||
POINTER_TOUCH_INFO touchInfo;
|
||||
POINTER_PEN_INFO penInfo;
|
||||
POINTER_INFO pointerInfo;
|
||||
UINT32 pointerId = GET_POINTERID_WPARAM(wp);
|
||||
POINTER_INPUT_TYPE pointerType = PT_POINTER;
|
||||
|
||||
// Retrieve common pointer information
|
||||
if (!GetPointerInfo(pointerId, &pointerInfo))
|
||||
@@ -628,7 +631,53 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
|
||||
else
|
||||
{
|
||||
// success, process pointerInfo
|
||||
int i = 0;
|
||||
if (!GetPointerType(pointerId, &pointerType))
|
||||
{
|
||||
// failure, call GetLastError()
|
||||
// set PT_POINTER to fall to default case below
|
||||
pointerType = PT_POINTER;
|
||||
}
|
||||
switch (pointerType)
|
||||
{
|
||||
case PT_TOUCH:
|
||||
// Retrieve touch information
|
||||
if (!GetPointerTouchInfo(pointerId, &touchInfo))
|
||||
{
|
||||
// failure, call GetLastError()
|
||||
}
|
||||
else
|
||||
{
|
||||
// success, process touchInfo
|
||||
// mark as handled to skip call to DefWindowProc
|
||||
//fHandled = TRUE;
|
||||
}
|
||||
break;
|
||||
case PT_PEN:
|
||||
// Retrieve pen information
|
||||
if (!GetPointerPenInfo(pointerId, &penInfo))
|
||||
{
|
||||
// failure, call GetLastError()
|
||||
}
|
||||
else
|
||||
{
|
||||
// success, process penInfo
|
||||
// mark as handled to skip call to DefWindowProc
|
||||
//fHandled = TRUE;
|
||||
//penInfo.pressure
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (!GetPointerInfo(pointerId, &pointerInfo))
|
||||
{
|
||||
// failure.
|
||||
}
|
||||
else
|
||||
{
|
||||
// success, proceed with pointerInfo.
|
||||
//fHandled = HandleGenericPointerInfo(&pointerInfo);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user