Skip to content

Cannot open game controller for raw input #12

Description

@mat1jaczyyy

Hi @mfakane, I'm trying to use your wrapper to receive raw input from game controllers. Here's an example controller I'm trying to read:

image

I've tried to modify SimpleExample to use either HidUsageAndPage.Joystick or HidUsageAndPage.Gamepad, but there is a Win32ErrorException. RegisterRawInputDevices returns false with GetLastError = 87, which is "The parameter is incorrect.".

I also tried to directly access it like this as well:

            try
            {
                // Register the HidUsageAndPage to watch any device.
                RawInputDevice.RegisterDevice(devices[0].UsageAndPage, RawInputDeviceFlags.ExInputSink | RawInputDeviceFlags.NoLegacy, window.Handle);

                Application.Run();
            }
            finally
            {
                RawInputDevice.UnregisterDevice(devices[0].UsageAndPage);
            }

I'm not sure if it's correct, but it returns the same error. What am I supposed to do?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions