oblitum / Interception

The Interception API aims to build a portable programming interface that allows one to intercept and control a range of input devices.
http://oblita.com/interception
1.32k stars 271 forks source link

What is mouse state 0xA and why do I get it when setting explicit filters? #153

Closed YourFutureHusband closed 1 year ago

YourFutureHusband commented 1 year ago

On rare occasions interception returns a mouse state of 0xA (10). Why is this happening when I set the following filters?

InterceptionContext context;
InterceptionDevice device;
InterceptionStroke stroke;

context = interception_create_context();
interception_set_filter(context, interception_is_mouse,
    INTERCEPTION_FILTER_MOUSE_BUTTON_1_DOWN | INTERCEPTION_FILTER_MOUSE_BUTTON_1_UP |
    INTERCEPTION_FILTER_MOUSE_BUTTON_2_DOWN | INTERCEPTION_FILTER_MOUSE_BUTTON_2_UP);

while (interception_receive(context, device = interception_wait(context), &stroke, 1) > 0)
{
    if (interception_is_mouse(device))
    {
        interception_send(context, device, &stroke, 1);

        InterceptionMouseStroke& mStroke = *(InterceptionMouseStroke*)&stroke;
        if (mStroke.state == 10)
        {
            std::count << "received an unknown mouse state" << std::endl;
        }
    }
}
interception_destroy_context(context);
YourFutureHusband commented 1 year ago

bitflags... was it wrong of me to assume two different strokes instead of one? (lbutton up (0x002) + rbutton up (0x008))