Add skeleton code for Windows multitouch, to be filled in by someone who can test :P

This commit is contained in:
Henrik Rydgard committed 2013-04-16 21:14:46 +02:00
1 parent 2347bc877a
commit 98daf18d56
3 files changed
+39 -1

No files matched your search

+38
View File
@@ -38,6 +38,8 @@
#include "XPTheme.h"
#endif
#define ENABLE_TOUCH 0
static BOOL g_bFullScreen = FALSE;
static RECT g_normalRC = {0};
@@ -209,6 +211,10 @@ namespace MainWindow
//accept dragged files
DragAcceptFiles(hwndMain, TRUE);
#if ENABLE_TOUCH
RegisterTouchWindow(hwndDisplay, TWF_WANTPALM);
#endif
SetFocus(hwndMain);
return TRUE;
@@ -304,6 +310,38 @@ namespace MainWindow
}
break;
case WM_TOUCH:
{
// TODO: Enabling this section will probably break things on Windows XP.
// We probably need to manually fetch pointers to GetTouchInputInfo and CloseTouchInputHandle.
#if ENABLE_TOUCH
UINT inputCount = LOWORD(wParam);
TOUCHINPUT *inputs = new TOUCHINPUT[inputCount];
if (GetTouchInputInfo((HTOUCHINPUT)lParam,
inputCount,
inputs,
sizeof(TOUCHINPUT)))
{
for (int i = 0; i < inputCount; i++) {
// TODO: process inputs here!
}
if (!CloseTouchInputHandle((HTOUCHINPUT)lParam))
{
// error handling
}
}
else
{
// GetLastError() and error handling
}
delete [] inputs;
return DefWindowProc(hWnd, message, wParam, lParam);
#endif
}
case WM_PAINT:
return DefWindowProc(hWnd, message, wParam, lParam);
default: