2014-01-19 21:54:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
2014-01-23 17:05:42 +00:00
|
|
|
typedef BOOL(WINAPI *getTouchInputProc)(
|
|
|
|
HTOUCHINPUT hTouchInput,
|
|
|
|
UINT cInputs,
|
|
|
|
PTOUCHINPUT pInputs,
|
|
|
|
int cbSize
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef BOOL(WINAPI *closeTouchInputProc)(
|
|
|
|
HTOUCHINPUT hTouchInput
|
|
|
|
);
|
|
|
|
|
|
|
|
typedef BOOL(WINAPI *registerTouchProc)(
|
|
|
|
HWND hWnd,
|
|
|
|
ULONG ulFlags
|
|
|
|
);
|
|
|
|
|
2014-01-19 21:54:49 +00:00
|
|
|
class TouchInputHandler
|
|
|
|
{
|
2014-01-23 17:05:42 +00:00
|
|
|
private:
|
|
|
|
std::map<int, int> touchTranslate;
|
|
|
|
getTouchInputProc touchInfo;
|
|
|
|
closeTouchInputProc closeTouch;
|
|
|
|
registerTouchProc registerTouch;
|
|
|
|
|
2014-01-19 21:54:49 +00:00
|
|
|
public:
|
|
|
|
TouchInputHandler();
|
|
|
|
~TouchInputHandler();
|
2014-01-23 17:05:42 +00:00
|
|
|
void handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
|
|
|
void registerTouchWindow(HWND wnd);
|
|
|
|
bool hasTouch();
|
2014-01-19 21:54:49 +00:00
|
|
|
private:
|
2014-09-17 07:32:21 +00:00
|
|
|
void disablePressAndHold(HWND hWnd);
|
2014-01-19 21:54:49 +00:00
|
|
|
void touchUp(int id, float x, float y);
|
|
|
|
void touchDown(int id, float x, float y);
|
|
|
|
void touchMove(int id, float x, float y);
|
|
|
|
};
|
|
|
|
|