WootingKb / wooting-rgb-sdk

Customize colors on Wooting Keyboard #WootDev
Mozilla Public License 2.0
62 stars 15 forks source link

Determine whether device is ISO or ANSI #38

Closed RobertBeekman closed 3 years ago

RobertBeekman commented 3 years ago

Hello,

For the Wooting Artemis plugin I'd like to be able to detect what kind of physical layout the device has. From what I can tell this is possible because Wootility shows the correct layout depending on what firmware you've flashed, either ISO or ANSI.

It would be nice if this could be added to the RGB SDK so that we know whether the extra ISO-only LEDs are present or not.

RobertBeekman commented 3 years ago

Hi, sorry to bump this but I was just wondering if there's any time indication for when we might see this added to the SDK, if at all? We're working towards a stable release of RGB.NET (the framework that drives Artemis) and it would be great if we could detect Wooting physical layout before then :).

simon-wh commented 3 years ago

Hi @RobertBeekman thanks for reminding me about this, figured it was about time I got this sorted for ye ;).

You wanna try out this branch? https://github.com/WootingKb/wooting-rgb-sdk/tree/feature/layout-detection I've got it implemented as a property of the struct returned by wooting_rgb_device_info, additionally I added the function wooting_rgb_device_layout which pulls it in directly for simplicity.

I also implemented the changes in my .NET wrapper which can be a reference implementation for yous https://github.com/simon-wh/Wooting.NET/blob/feature/layout/Wooting.NET/RGBControl.cs

Let me know how you get on, I tested it with all the keyboards I have and seemed to be all good for me. If it seems good to you I'll open a PR, get it merged and make a release :)

RobertBeekman commented 3 years ago

Hey Simon,

We got good results in RGB.NET/Artemis, I had several people try it out. I used the device info struct since we already leverage that to get the model etc.

So all looks good to me, thanks!

PastaJ36 commented 3 years ago

@RobertBeekman do you filter for keyboard size (60% / TKL / Full Size) as well?

RobertBeekman commented 3 years ago

@PastaJ36 yes we use WOOTING_DEVICE_TYPE retrieved via wooting_rgb_device_info but that is limited to TKL and full size.

We use this to determine which LED IDs to make available if no valid layout file is loaded. It's not a huge issue for us as long as we get the correct model number. That's what we use to load the correct layout file.

In this case I suppose you're thinking of the 60HE?

PastaJ36 commented 3 years ago

@PastaJ36 yes we use WOOTING_DEVICE_TYPE retrieved via wooting_rgb_device_info but that is limited to TKL and full size.

We use this to determine which LED IDs to make available if no valid layout file is loaded. It's not a huge issue for us as long as we get the correct model number. That's what we use to load the correct layout file.

In this case I suppose you're thinking of the 60HE?

Yeah but I see @simon-wh already set it up to easily add the device. Should we already add it now that you're working on it anyway? We already know the VID/PID and such

RobertBeekman commented 3 years ago

Sure thing! Saves us from having to do a separate update later down the line 👍

simon-wh commented 3 years ago

Re: adding 60HE support to this, I'm a little hesitant to throw it in until we've finalised how we approach the keyboard matrix handling for it. Given the 60HE is missing the first key row you get on the rest I imagine we'll go with it starting at row 1 to line up with the rest, but I imagine I'll want to adjust the USB communication to make it more efficient so I think we'll leave the 60HE support for a bit til we're a bit later down the line with 60HE firmware development.

Re: These changes and being merged, I've opened a PR and just need @PastaJ36 to have a wee look then I'll get a full release going