Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/TouchInputHandler.h
3185 views
1
#pragma once
2
3
typedef BOOL(WINAPI *getTouchInputProc)(
4
HTOUCHINPUT hTouchInput,
5
UINT cInputs,
6
PTOUCHINPUT pInputs,
7
int cbSize
8
);
9
10
typedef BOOL(WINAPI *closeTouchInputProc)(
11
HTOUCHINPUT hTouchInput
12
);
13
14
typedef BOOL(WINAPI *registerTouchProc)(
15
HWND hWnd,
16
ULONG ulFlags
17
);
18
19
class TouchInputHandler
20
{
21
public:
22
TouchInputHandler();
23
void handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
24
void registerTouchWindow(HWND wnd);
25
bool hasTouch();
26
27
private:
28
int ToTouchID(int windowsID, bool allowAllocate = true);
29
bool GetTouchPoint(HWND hWnd, const TOUCHINPUT &input, float &x, float &y);
30
31
void disablePressAndHold(HWND hWnd);
32
void touchUp(int id, float x, float y);
33
void touchDown(int id, float x, float y);
34
void touchMove(int id, float x, float y);
35
36
int touchIds[10]{};
37
getTouchInputProc touchInfo;
38
closeTouchInputProc closeTouch;
39
registerTouchProc registerTouch;
40
};
41
42
43