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

Raw input does not work with multiple windows. #892

Open
GoogleCodeExporter opened this issue Jan 1, 2016 · 0 comments
Open

Raw input does not work with multiple windows. #892

GoogleCodeExporter opened this issue Jan 1, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I'm using the HEAD version from the SVN.
I believe that the following solution is better.

DeviceRI.cpp

void Device::RegisterDevice( SlimDX::Multimedia::UsagePage usagePage, 
SlimDX::Multimedia::UsageId usageId, DeviceFlags flags, IntPtr target, bool 
addThreadFilter )
    {
        RAWINPUTDEVICE device;
        device.usUsagePage = static_cast<USHORT>( usagePage );
        device.usUsage = static_cast<USHORT>( usageId );
        device.dwFlags = static_cast<DWORD>( flags );
        device.hwndTarget = static_cast<HWND>( target.ToPointer() );

        if( RegisterRawInputDevices( &device, 1, sizeof(RAWINPUTDEVICE) ) <= 0 )
            throw gcnew Win32Exception();

        if (addThreadFilter)
        {
            if( filter == nullptr)
                filter = gcnew InputMessageFilter();

            Application::AddMessageFilter( filter );
        }
    }

Original issue reported on code.google.com by [email protected] on 1 Feb 2013 at 10:15

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

No branches or pull requests

1 participant