Giter Site home page Giter Site logo

Comments (3)

CalcProgrammer1 avatar CalcProgrammer1 commented on August 27, 2024

I have a modified version of the libusb-backend hidapi.c that compiles on Windows. It is able to control RGB lighting devices in keyboards and mice if the appropriate interfaces have the WinUSB driver with zadig. It's basically just a hack to remove the linux-specific stuff in the libusb backend and could use some cleanup, but this method does work if you wish to use the hidapi library in your code and still access these devices in Windows.

https://gitlab.com/CalcProgrammer1/OpenRGB/-/blob/master/dependencies/hidapi/hidapi.c

My OpenRGB project uses the Linux and MacOS native versions of hidapi just fine, but the Windows version does not work for whatever reason. It detects some devices but can't control them. If I use my hacked up libusb hidapi.c in place of the released library, it works just fine.

I was looking at the Redragon K556 keyboard software in API Monitor to see why that software has no problems controlling an RGB keyboard with the HID driver but my implementation requires WinUSB. This is what I'm seeing when I change settings:

image

I don't see an obvious call to any hid_write or hid_set_feature_report equivalent function in the Windows HID library. I am monitoring HID.dll and the wrapper DLL that the keyboard software uses.

from hidapi.

mcuee avatar mcuee commented on August 27, 2024

Actually I think it may not be a bad idea to have a libusb based Windows backend (using Zadig and WinUSB driver) to take away some of the limitations of the Windows HID driver. Some users may want to use that way.

from hidapi.

Youw avatar Youw commented on August 27, 2024

Agree, that would be a good option.

The usage of POSIX API would need to be replaced for libusb backend implementation of hidapi (preferably by C11 imho).

from hidapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.