Giter Club home page Giter Club logo

Comments (7)

GiantNuker avatar GiantNuker commented on July 28, 2024

I tried to make it async but probably missed something obvious Image
(I added an event handler to the main file)

Note: I have no idea what im doing ^

from rgb_keyboard.

dokutan avatar dokutan commented on July 28, 2024

The official software implements changing multiple keys in a single packet, this software does not (one packet per key is used), that is the main reason for the speed difference. I chose to implement it this way because less reverse engineering effort would be required.

Custom animations are certainly a nice feature, and i would welcome your efforts. A few things i would keep in mind about the potential design:

  • The existing code sucks (in some places more than in others), rewriting parts might be good
  • Different keyboards use different keycodes to change the individual key colors
  • How should animations be defined? I would prefer having animations as executables in a scripting language that simply call rgb_keyboard, mabe a Lua or Python API should be created for that.
  • I personally wouldn't bother with the async libusb API as the biggest speedup should come from changing multiple keys in a single packet. However I won't reject it if you got the async API working.
  • The key colors are stored on the keyboard, constantly changing them could wear out the flash(?) storage of the controller

As far as capturing USB data goes:
A simple description:
https://github.com/dokutan/rgb_keyboard/tree/master/doc#capturing-usb-data
More detailed explanations:
https://bytepunk.wordpress.com/2017/03/25/reverse-engineering-a-usb-mouse/
https://github.com/pez2001/razer_chroma_drivers/wiki/Reverse-Engineering-USB-Protocol

I hope this answers your questions, feel free to ask if there is anything else.

from rgb_keyboard.

GiantNuker avatar GiantNuker commented on July 28, 2024

Thanks for the information.
I didnt think about the flash memory, but probably shouldve - there's no way to just change the color without updating the memory I'd assume.

How should animations be defined?
welllll i was just gonna hardcode anything i wanted :P

I tried for async but it didnt work properly for me, everything probably has to go in order anyway.

from rgb_keyboard.

GiantNuker avatar GiantNuker commented on July 28, 2024

Also before i mess with this more, im probably going to port it to kotlin so i can work with it easily, but i'll at least post how to change multiple at a time once i figure it out

from rgb_keyboard.

GiantNuker avatar GiantNuker commented on July 28, 2024

It appears to be section based, and sequential. This made all the function keys white
Keyboard Image
Code Image
Just one question: Do you have any idea what the first half of the packet is? Wireshark Image

from rgb_keyboard.

dokutan avatar dokutan commented on July 28, 2024

The first half is just protocol overhead, you generally only have to consider the highlighted data section, with exception of transfer parameters, e.g. endpoints.

from rgb_keyboard.

dokutan avatar dokutan commented on July 28, 2024

I'm closing this as your questions seem to be answered and no implementation of a custom animation API is currently planned (due to the flash memory problem).

from rgb_keyboard.

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.