2014-01-19 22:54:49 +01:00
|
|
|
#pragma once
|
|
|
|
|
2014-01-23 18:05:42 +01: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 22:54:49 +01:00
|
|
|
class TouchInputHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TouchInputHandler();
|
2014-01-23 18:05:42 +01:00
|
|
|
void handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
|
|
|
void registerTouchWindow(HWND wnd);
|
|
|
|
bool hasTouch();
|
2017-03-14 22:16:09 -07:00
|
|
|
|
2014-01-19 22:54:49 +01:00
|
|
|
private:
|
2017-04-11 18:48:40 -07:00
|
|
|
int ToTouchID(int windowsID, bool allowAllocate = true);
|
2017-04-11 18:53:00 -07:00
|
|
|
bool GetTouchPoint(HWND hWnd, const TOUCHINPUT &input, float &x, float &y);
|
2017-04-11 18:48:40 -07:00
|
|
|
|
2014-09-17 09:32:21 +02:00
|
|
|
void disablePressAndHold(HWND hWnd);
|
2014-01-19 22:54:49 +01: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-14 22:16:09 -07:00
|
|
|
|
2017-08-07 13:18:19 +02:00
|
|
|
int touchIds[10]{};
|
2017-03-14 22:16:09 -07:00
|
|
|
getTouchInputProc touchInfo;
|
|
|
|
closeTouchInputProc closeTouch;
|
|
|
|
registerTouchProc registerTouch;
|
2014-01-19 22:54:49 +01:00
|
|
|
};
|
|
|
|
|