From Adrien Grandemange, "On Windows 7 and 8, mouse messages are generated in addition to touch messages, which leads to duplicate PUSH, DRAG and RELEASE events in OSG. Besides, the mouse and touch messages referring to the same user input are not necessarily sent at the same time, due to gesture translation done by Windows by default, such as double-tap => double-click and long-push => right-click.

The delay between the 2 types of messages is more noticeable on Windows 8 and leads to serious disruptions in our application.

Mouse messages generated by touch input are only present for legacy support. I think they should be filtered out by OSG (real click events originating from a physical mouse will of course still go through).

This is what this patch does, according to this suggestion: http://msdn.microsoft.com/en-us/library/dd693088%28v=VS.85%29.aspx (third issue in this page)."
This commit is contained in:
Robert Osfield
2013-10-01 09:11:26 +00:00
parent 68c22efa58
commit 76d833f332

View File

@@ -29,6 +29,8 @@
#include <sstream>
#include <windowsx.h>
#define MOUSEEVENTF_FROMTOUCH 0xFF515700
#if(WINVER < 0x0601)
// Provide Declarations for Multitouch
@@ -2457,6 +2459,8 @@ void GraphicsWindowWin32::transformMouseXY( float& x, float& y )
LRESULT GraphicsWindowWin32::handleNativeWindowingEvent( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH) return TRUE;
//!@todo adapt windows event time to osgGA event queue time for better resolution
double eventTime = getEventQueue()->getTime();
double resizeTime = eventTime;