Git Product home page Git Product logo

Comments (8)

dokutan avatar dokutan commented on August 11, 2024 1

Is there a way track any logs to find something out?

You can use wireshark to capture the USB communication from the official software and rgb_keyboard for options that don't work. This would allow a direct comparison of the relevant packets, thus giving the best chance to fix these problems.

Here is a brief explanation of the process, here are more detailed guides:
https://bytepunk.wordpress.com/2017/03/25/reverse-engineering-a-usb-mouse/
https://github.com/pez2001/razer_chroma_drivers/wiki/Reverse-Engineering-USB-Protocol
Feel free to ask if there is anything else.

from rgb_keyboard.

darrynjordan avatar darrynjordan commented on August 11, 2024 1

@dokutan I have not tried any remapping, this was simply for custom led patterns.

Thanks, that was a great suggestion. I managed to find the required hex values by running through all of the ANSI keycodes.
Making the following changes has fixed my issues for the K552RGB-1:

// keycodes for custom led patterns (brazilian layout)
const std::map<std::string, std::array<uint8_t, 3>> rgb_keyboard::keyboard::keycodes_brazil = {
	...
	{"Apostrophe", { 0x32, 0xde, 0x00 }},
	...
	{"Bracket_l", { 0xf3, 0x9f, 0x00 }},
	{"Bracket_r", { 0xf6, 0xa2, 0x00 }},
	...
	{"Semicolon", { 0x2f, 0xdb, 0x00 }},
	...
	{"Backslash", { 0xf9, 0xa5, 0x00 }},
	...
	{"Slash", { 0x72, 0x1d, 0x01 }},
	...
	{"Tilde", { 0x93, 0x3f, 0x00 }},
	...
};

It would be great to know if the required values are different for the K552RGB and K552RGB-2?
Are you happy for me to make a pull request with the changes applied?

from rgb_keyboard.

darrynjordan avatar darrynjordan commented on August 11, 2024

Interestingly, my Redragon K552RGB-1 reports the following under lsusb:

0c45:5004 Microdia Redragon Mitra RGB Keyboard

from rgb_keyboard.

dokutan avatar dokutan commented on August 11, 2024

@darrynjordan The keyboard is identified by its vendor and product id (0c45 and 5004), the name is taken from the udev hardware database. Multiple keyboards have the same ids, but only one is entered into the hardware database, therefore you see the wrong name.

The hwdb(7) manpage has the details if you are interested, or you can edit the entry at https://usb-ids.gowdy.us/.

from rgb_keyboard.

darrynjordan avatar darrynjordan commented on August 11, 2024

Interesting! Thanks @dokutan. I didn't know about this database.

Please note that I have found the following erroneous mappings from label to physical key:

Label Physical Key
Tilde Apostrophe
Bracket_l Bracket_r
Bracket_r None
Backslash None
Semicolon Slash
Apostrophe Tilde
Slash None

For testing I use rgb_keyboard -Y brazil -P example.conf.

I'll be happy to capture the output of the Redragon software using wireshark for these keys.

from rgb_keyboard.

dokutan avatar dokutan commented on August 11, 2024

@darrynjordan Did this affect remapping of the keys or or custom led patterns?

Instead of directly using wireshark, it might be easier for you to simply edit the labels or remove entries in one of the keycodes_* (leds) or _keymap_offsets_* (key mapping) maps in https://github.com/dokutan/rgb_keyboard/blob/master/include/data.cpp. Only if you lack information e.g. the code for a specific key, wireshark would be necessary.

If you attach the fixed map or usb captures i would add a new layout for the K552 (of course you are welcome to do it yourself if you want).

from rgb_keyboard.

dokutan avatar dokutan commented on August 11, 2024

@darrynjordan Thanks for figuring out the correct values, i have added a new layout brazil_k552rgb1 in 7cbf3b2 instead of merging your update to the brazil layout, i hope this acceptable to you. This is to avoid any accidental regressions for other keyboards. Please let me know if this works for you.

from rgb_keyboard.

darrynjordan avatar darrynjordan commented on August 11, 2024

Yep, that works for me @dokutan. Thanks.

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.