mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
disable press and hold for Windows Touch
This commit is contained in:
parent
780ed765c7
commit
41f67857f5
@ -98,6 +98,28 @@ void TouchInputHandler::handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam,
|
||||
}
|
||||
}
|
||||
|
||||
// from http://msdn.microsoft.com/en-us/library/ms812373.aspx
|
||||
// disable the press and hold gesture for the given window
|
||||
void TouchInputHandler::disablePressAndHold(HWND hWnd)
|
||||
{
|
||||
// The atom identifier and Tablet PC atom
|
||||
ATOM atomID = 0;
|
||||
LPCTSTR tabletAtom = _T("MicrosoftTabletPenServiceProperty");
|
||||
|
||||
// Get the Tablet PC atom ID
|
||||
atomID = GlobalAddAtom(tabletAtom);
|
||||
|
||||
// If getting the ID failed, return false
|
||||
if (atomID == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to disable press and hold gesture by
|
||||
// setting the window property, return the result
|
||||
SetProp(hWnd, tabletAtom, (HANDLE)1);
|
||||
}
|
||||
|
||||
void TouchInputHandler::touchUp(int id, float x, float y){
|
||||
TouchInput touchevent;
|
||||
touchevent.id = id;
|
||||
@ -142,7 +164,10 @@ void TouchInputHandler::touchMove(int id, float x, float y){
|
||||
void TouchInputHandler::registerTouchWindow(HWND wnd)
|
||||
{
|
||||
if (hasTouch())
|
||||
{
|
||||
registerTouch(wnd, TWF_WANTPALM);
|
||||
disablePressAndHold(wnd);
|
||||
}
|
||||
}
|
||||
|
||||
bool TouchInputHandler::hasTouch(){
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
void registerTouchWindow(HWND wnd);
|
||||
bool hasTouch();
|
||||
private:
|
||||
void disablePressAndHold(HWND hWnd);
|
||||
void touchUp(int id, float x, float y);
|
||||
void touchDown(int id, float x, float y);
|
||||
void touchMove(int id, float x, float y);
|
||||
|
Loading…
Reference in New Issue
Block a user