Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't intercept input events #2

Open
wraith321 opened this issue Jun 17, 2019 · 0 comments
Open

Can't intercept input events #2

wraith321 opened this issue Jun 17, 2019 · 0 comments

Comments

@wraith321
Copy link

wraith321 commented Jun 17, 2019

Hey,

I am currently trying to get rid of fake mouse input events generated by touch events on windows.
There seems to have been a fix for this in place some time ago, but it is currently commented out in the engine source:

#if WINVER >= 0x0601
	// ORION - REMOVED FOR WACOM SUPPORT!
	/*
	if (IsFakeMouseInputMessage(msg))
	{
		return 0;
	}
	*/
#endif

And returning true ("handled") for these events in your plugin doesn't work because it only sets "bMessageExternallyHandled" to true, but this boolean is only considered for events that weren't handled by the engine at all.

Is there any other way to fix this while still using the launcher version of the engine?

Here the code I am currently using for detecting fake mouse events:

virtual bool ProcessMessage(HWND Hwnd, uint32 Message, WPARAM WParam, LPARAM LParam, int32& OutResult) override
{
	if (Message == WM_LBUTTONUP || Message == WM_LBUTTONDOWN)
	{
		if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH)
		{
			GEngine->AddOnScreenDebugMessage(INDEX_NONE, 5.0f, FColor::Red, TEXT("Input was Touch"));
			return true;
		}
		else
		{
			GEngine->AddOnScreenDebugMessage(INDEX_NONE, 5.0f, FColor::Red, TEXT("Input was Non-Touch"));
		}
	}
	return false;
}

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant