mirror of
https://github.com/libretro/ppsspp.git
synced 2024-12-11 10:24:43 +00:00
4a4488eb98
Check for touch support and enable it automatically if available. It's probably possible to hack around Vista with the HID stuff but I don't think Vista that want multitouch is a large enough group to invest the time.
41 lines
793 B
C++
41 lines
793 B
C++
#pragma once
|
|
|
|
#include <map>
|
|
|
|
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
|
|
);
|
|
|
|
class TouchInputHandler
|
|
{
|
|
private:
|
|
std::map<int, int> touchTranslate;
|
|
getTouchInputProc touchInfo;
|
|
closeTouchInputProc closeTouch;
|
|
registerTouchProc registerTouch;
|
|
|
|
public:
|
|
TouchInputHandler();
|
|
~TouchInputHandler();
|
|
void handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
|
|
void registerTouchWindow(HWND wnd);
|
|
bool hasTouch();
|
|
private:
|
|
void touchUp(int id, float x, float y);
|
|
void touchDown(int id, float x, float y);
|
|
void touchMove(int id, float x, float y);
|
|
};
|
|
|