2014-01-19 21:54:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
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
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
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();
|
2017-03-15 05:16:09 +00:00
|
|
|
|
2014-01-19 21:54:49 +00:00
|
|
|
private:
|
2017-04-12 01:48:40 +00:00
|
|
|
int ToTouchID(int windowsID, bool allowAllocate = true);
|
2017-04-12 01:53:00 +00:00
|
|
|
bool GetTouchPoint(HWND hWnd, const TOUCHINPUT &input, float &x, float &y);
|
2017-04-12 01:48:40 +00:00
|
|
|
|
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);
|
2017-03-15 05:16:09 +00:00
|
|
|
|
2017-08-07 11:18:19 +00:00
|
|
|
int touchIds[10]{};
|
2017-03-15 05:16:09 +00:00
|
|
|
getTouchInputProc touchInfo;
|
|
|
|
closeTouchInputProc closeTouch;
|
|
|
|
registerTouchProc registerTouch;
|
2014-01-19 21:54:49 +00:00
|
|
|
};
|
|
|
|
|