Skip to content

How to block all Windows Touch Events? #4

@TobiasSchwirten

Description

@TobiasSchwirten

Hi Everyone,
the tool is really nice! Runs smooth so far.
But I have a problem as I want the bridge not to forward any of the hooked wm touch events.
It would ideal if Touch2Tuio collects all the touch events and only forwards tuio so that there are no native WinTouch events anymore (at least in the hooked window).

In TouchHook.cpp is this part:

LRESULT CALLBACK LowLevelMouseProc(int nCode, WPARAM wParam, LPARAM lParam)
{
    if (nCode < 0 ) // do not process message 
    {
        return CallNextHookEx(0, nCode, wParam, lParam);
    }

    LPMSLLHOOKSTRUCT msg = (LPMSLLHOOKSTRUCT)lParam;
    if (msg->flags & LLMHF_INJECTED) // block injected events (in most cases generated by touches)
    {
        sprintf_s(s_buf, "Blocked injected (touch) mouse event\n");
        WriteConsole(s_out, s_buf, strlen(s_buf), &s_ccount, 0);
        return 1;
    }

    // forward event
    return CallNextHookEx(0, nCode, wParam, lParam);
}

Setting the second if-routine quick and dirty to "true" makes it a little better, the native win touch does not trigger buttons anymore, but can for example select text or highlight buttons. But still something is happening and you can always see the small cross hairs.

Any Idea how to really get the native touch quiet :-)?

Thanks!

Best regards,
Tobi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions