These are chat archives for CoraleStudios/Colore

6th
Nov 2015
Ryan Hill
@Aurous
Nov 06 2015 04:08
So i was wandering if anyone has some example code on the deathadder?
Dariusz Niemczyk
@Palid
Nov 06 2015 08:17
@WolfspiritM if I only knew how to verify what keyboard layout it is... IMHO it's about Colore and SDK
when you want to light Z you light Z and don't care about keyboard layout
Adam Hellberg
@Sharparam
Nov 06 2015 12:20
@Palid @WolfspiritM the key layout issue will be there until Razer provides a way to detect layouts and even then it will be hundreds of special cases to consider unless they do like sensible developers and put it in the drivers. This issue is in the SDK itself and as such there is nothing we can do to detect it in Colore currently
Brandon Scott
@brandonscott
Nov 06 2015 12:28
It's a shame
We are adding a SafeKey check in shortly
Dariusz Niemczyk
@Palid
Nov 06 2015 13:37
@Sharparam I thought about the same thing (SDK), but I'm really wondering if it's going to be added any time soon.
Brandon Scott
@brandonscott
Nov 06 2015 13:39
@Palid unlikely
Adrian
@WolfspiritM
Nov 06 2015 14:50
A workaround for now to find out which layout it is: The System Windows Forms Namespace does have a "InputLanguage.CurrentInputLanguage" which could be used I assume. I've not used it yet for anything, but InputLanguage.CurrentInputLanguage.LayoutName for me returns "German". It's not using the actual Keyboard Layout but the Keyboard Layout definied in Windows.
Adam Hellberg
@Sharparam
Nov 06 2015 14:52
@WolfspiritM The current system language doesn't necessarily correspond to the actual physical layout of the keyboard, which is where the problem surfaces
Adrian
@WolfspiritM
Nov 06 2015 14:55
@Sharparam It's not the system language it returns. My system is set to english. It's returning the input device configuration and I'd say mostly this is set correctly as Z wouldn't be Z for example. But I agree that the layout you define in windows doesn't mean the hardware does really have that layout. That's why it's a workaround...it'd be better then nothing.
Adam Hellberg
@Sharparam
Nov 06 2015 14:55
s/system language/input language/. I know a couple people who remap their caps lock to escape for example.
Adrian
@WolfspiritM
Nov 06 2015 14:57
I agree...handling remapped keys would be a way harder problem
Adam Hellberg
@Sharparam
Nov 06 2015 14:59
Razer needs to provide a definite (this is important) list of ALL available physical layouts of the keyboard as well as provide a function that accurately returns the physical layout of the keyboard. Otherwise there is no reliable way to even try to handle it.
problem is that since they seem hellbent on putting this workload on the developers, every developer needs to implement their own solution to this since they won't add it natively in the SDK.
Adrian
@WolfspiritM
Nov 06 2015 15:00
Or make their SDK light up the correct key no matter what Keyboard Layout...
Adam Hellberg
@Sharparam
Nov 06 2015 15:00
people using Colore can use the methods in there of course, but those not using C# and working with the SDK directly will produce hundreds of duplicate methods to do this
Adrian
@WolfspiritM
Nov 06 2015 15:03
It's one big flaw I saw in their SDK as I was playing around, that they didn't think of other keyboard layouts. Let's just hope they'll work on it.
Adam Hellberg
@Sharparam
Nov 06 2015 15:03
Then you also have to consider that some people may have multiple keyboards plugged in with differing layouts
it's likely a small enough amount to be irrelevant, but still an interesting thought
Adrian
@WolfspiritM
Nov 06 2015 15:08
not sure if that'd be so hard for their SDK that is doing the USB part to switch out keys (Y and Z for example) depending on the layout of the device it's sending to. Then it doesn't matter how many keyboards are plugged in
Adam Hellberg
@Sharparam
Nov 06 2015 15:09
it's the reason this should be put in the driver so it's as close to the hardware as possible, or firmware even. but they've already released the keyboards so it's a bit late for that
the SDK doesn't (and probably won't for the foreseeable future) provide granular access to specific devices, only to "all <device type here>" so the SDK can't be used to filter devices out
Dariusz Niemczyk
@Palid
Nov 06 2015 15:12
@Sharparam tbh from what I'm reading the SDK is a piece of crap.
Adrian
@WolfspiritM
Nov 06 2015 15:12
Not really talking about the API part of the SDK...more the backend (driver) part that does the work. The driver knows what layout it is and it could fix this. However...it's totally Razers part to do that
Dariusz Niemczyk
@Palid
Nov 06 2015 15:16
Wait. We should have access to the keyboard's product number, or sth.
this way we can at least try doing an ugly fix.
Model number*
Adam Hellberg
@Sharparam
Nov 06 2015 15:18
you can query a GUID and get the device type and whether it's connected, not any details about its layout
see: DeviceType struct and Query method on Chroma class
DeviceInfo*
Dariusz Niemczyk
@Palid
Nov 06 2015 15:18
Well, we can try with the Model Number then.
Adam Hellberg
@Sharparam
Nov 06 2015 15:19
it cannot be queried
we can only get type of device (keyboard, mouse et.c) and whether it's connected
Dariusz Niemczyk
@Palid
Nov 06 2015 15:20
@Sharparam you sure that it can't be queried? I'm not talking about SDK now.
Let's just agree that SDK sucks and try different methods. :P
Adam Hellberg
@Sharparam
Nov 06 2015 15:20
you could probably start making your own stuff to read USB data, but then you're reverse engineering and breaking rules and shit
Adrian
@WolfspiritM
Nov 06 2015 15:20
You could query the USB somehow
Dariusz Niemczyk
@Palid
Nov 06 2015 15:21
tbh if Razer would start doing something against 'illegal rev-eng' in this case they would lose a lot of fanbase.
Adrian
@WolfspiritM
Nov 06 2015 15:21
Even having the model...I think using InputLanguage.CurrentInputLanguage as an ugly workaround would be easier instead somehow mapping model/guid to region to key
Dariusz Niemczyk
@Palid
Nov 06 2015 15:21
but yeah, let's not go into this discussion. :D
@WolfspiritM There's a problem with ugly workarounds: they are ugly and always do a problem in edge cases.
and here the edge case isn't even so edge-like.
Adrian
@WolfspiritM
Nov 06 2015 15:23
Querying the USB for a model number is nothing more then a ugly workaround, too...
Dariusz Niemczyk
@Palid
Nov 06 2015 15:23
True, but a bit more bulletproof.
Adam Hellberg
@Sharparam
Nov 06 2015 15:25
@/all Whoever had issues with exceptions from UnInit can you try using feature/uninit-improvement and see if that fixes the issue?
Adrian
@WolfspiritM
Nov 06 2015 15:27
@Palid I don't really see where it would be much more bulletproof. It won't fix multiple keyboards with different layouts nor remapped keys. But you can sure try querying USB :-)
@Sharparam I will try it later. Thanks!
Adam Hellberg
@Sharparam
Nov 06 2015 15:28
@WolfspiritM also if you find issues with it please comment about them here: CoraleStudios/Colore#108
Adrian
@WolfspiritM
Nov 06 2015 15:28
@Sharparam alright
Dariusz Niemczyk
@Palid
Nov 06 2015 15:30
@WolfspiritM will do if I have some time this weekend
got so many tickets that I'll have to work overtime on the weekend :(
ok so i have my code above
and it keeps giving me this throw exception
any ideas on a work around or what i did wrong?
Nico
@njbmartin
Nov 06 2015 21:49
That means that the ChromaSDK hasn't been enabled
Ryan Hill
@Aurous
Nov 06 2015 21:52
yep... i thought i had enabled it.. i guess in the updates or something on my computer i needed to reenable it...
Nico
@njbmartin
Nov 06 2015 21:52
In synapse, go to any chroma device and you'll see a Chroma Apps menu item. make sure "Chroma Apps" is enabled
yeah, the latest update to synapse adding this functionality made it disabled by default
certainly caught me out
Ryan Hill
@Aurous
Nov 06 2015 21:57
I just used the reg file to enable, and the codes magically working, of course
Adam Hellberg
@Sharparam
Nov 06 2015 21:58
reg files aren't used anymore since the release of the SDK
and integration in synapse
Nico
@njbmartin
Nov 06 2015 22:03
yeah, that wasn't made clear to the dev community when synapse updated ;)
Ryan Hill
@Aurous
Nov 06 2015 22:04
Do you even need to close synapse now? Or can you just leave it open?
Adam Hellberg
@Sharparam
Nov 06 2015 22:05
i think there can still be issues with advanced profiles, but maybe they fixed that too
Ryan Hill
@Aurous
Nov 06 2015 22:07
Ah, that's good
Nico
@njbmartin
Nov 06 2015 22:07
not yet, the current public SDK version still has an issue with profiles overlapping
Ryan Hill
@Aurous
Nov 06 2015 22:08
How would I use RGB with corale.colore.core.color?
Adam Hellberg
@Sharparam
Nov 06 2015 22:09
var color = new Color(r, g, b);
@brandonscott said there's an issue with one of the constructors but i don't think it's the byte one. he has yet to tell me which one has issues though
Ryan Hill
@Aurous
Nov 06 2015 22:10
Thank you
Nico
@njbmartin
Nov 06 2015 22:22
oh i remember @brandonscott saying there was an issue with one of them having the R and B swapped
Adam Hellberg
@Sharparam
Nov 06 2015 22:23
@njbmartin CoraleStudios/Colore#92
Ryan Hill
@Aurous
Nov 06 2015 22:35
So why isn't the color codes set up to read in int instead of byte?
Adam Hellberg
@Sharparam
Nov 06 2015 23:39
@Aurous RGB values are 0-255, same range as a byte. this is also how they are constructed internally in the sdk (or via the int constructor on Color, taking a 32bit integer in the format of 0xAARRGGBB)
0xAABBGGRR*