Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Unable to set colors for some keys #43

Closed
antonpup opened this issue May 26, 2016 · 13 comments
Closed

Unable to set colors for some keys #43

antonpup opened this issue May 26, 2016 · 13 comments
Assignees
Labels

Comments

@antonpup
Copy link

I am experiencing an issue where I cannot set color for some keys on a Corsair Strafe RGB and I cannot change the color of the DPI indicator on Corsair Sabre RGB. I am able to change color of other lights on both the keyboard and mouse, but not the Windows Lock, Brightness, and mouse DPI lights.

//Do not work, keys stay black.
keyboard[CorsairKeyboardKeyId.Brightness].Led.Color = color;
keyboard[CorsairKeyboardKeyId.WinLock].Led.Color = color;

Is this an issue with CUE or on my end?

@RobertBeekman
Copy link
Collaborator

Hey, I've asked Corsair about the DPI indicator before. It's intended to not be changeable through the sdk, sadly :c

@DarthAffe DarthAffe self-assigned this May 26, 2016
@DarthAffe
Copy link
Owner

DarthAffe commented May 26, 2016

I couldn't reproduce this so far but I'm using a K95 and this could be keyboard related.
Could you try to run the 'color_pulse'-example provided with the CUE-SDK and check if the keys are correctly colored there? This would be the easiest way to see if it has something to do with CUE/SDK.

In case you don't have the SDK-code I just created a binary from it http://wyrez.org/uploads/color_pulse_example.zip

@antonpup
Copy link
Author

All keys are properly lit up in the provided example.

@DarthAffe
Copy link
Owner

Ah I was able to reproduce the behavior you described, but it's nothing related to some special keys.
Could it be that you use some brush which contains the brightness- and winlock-key?
If so you can't access the keys afterwards directly since the brush will always overwrite it. This could be workarounded by using the 'IsLocked'-Flag but the preferred way would be something like this:

CueSDK.Initialize();
CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
if (keyboard == null)
    throw new WrapperException("No keyboard found");

keyboard.Brush = new SolidColorBrush(Color.Black);
keyboard.Update();

IKeyGroup specialKeyGroup = new ListKeyGroup(keyboard, CorsairKeyboardKeyId.Brightness, CorsairKeyboardKeyId.WinLock);
specialKeyGroup.Brush = new SolidColorBrush(Color.Aqua);

// Replacing the specialKeyGroup with this won't work even if it seems to be the same
//keyboard[CorsairKeyboardKeyId.Brightness].Led.Color = Color.Aqua;
//keyboard[CorsairKeyboardKeyId.WinLock].Led.Color = Color.Aqua;

keyboard.Update();

Let me know if this helps. If not we would need to investigate a bit further if the strafe uses different IDs or something.

@antonpup
Copy link
Author

antonpup commented May 26, 2016

I don't use brushes, I set each key individually as shown prior. How would IsLocked workaround work?

But let me try making brushes for those two keys.

@DarthAffe
Copy link
Owner

DarthAffe commented May 26, 2016

Just set IsLocked to true before updating the keyboard like this: (And remember to unlock it first if you ever want to change the color.)

keyboard[CorsairKeyboardKeyId.Brightness].Led.Color = Color.Aqua;
keyboard[CorsairKeyboardKeyId.Brightness].Led.IsLocked = true;
keyboard[CorsairKeyboardKeyId.WinLock].Led.Color = Color.Aqua;
keyboard[CorsairKeyboardKeyId.WinLock].Led.IsLocked = true;
keyboard.Update();

But I'm pretty sure this will not help if you don't use brushes.

@DarthAffe DarthAffe reopened this May 26, 2016
@antonpup
Copy link
Author

I just tried with creating two brushes, one for winlock other for brightness. Same result, keys are not set.

@DarthAffe
Copy link
Owner

DarthAffe commented May 26, 2016

Ok this is weird ... could you please run something like this

foreach (CorsairKey key in keyboard)
    Debug.WriteLine(key.KeyId + ": " + (int)key.KeyId + " - " + key.KeyRectangle);

and post me the result?

@antonpup
Copy link
Author

Here you go:

CLK_Logo: 154 - {X=10,Y=3,Width=14,Height=13}
GraveAccentAndTilde: 13 - {X=10,Y=60,Width=13,Height=13}
Escape: 1 - {X=10,Y=32,Width=13,Height=13}
F1: 2 - {X=42,Y=32,Width=13,Height=13}
F2: 3 - {X=61,Y=32,Width=13,Height=13}
F3: 4 - {X=81,Y=32,Width=13,Height=13}
F4: 5 - {X=99,Y=32,Width=13,Height=13}
F6: 7 - {X=152,Y=32,Width=13,Height=13}
F5: 6 - {X=132,Y=32,Width=13,Height=13}
F8: 9 - {X=189,Y=32,Width=13,Height=13}
F7: 8 - {X=170,Y=32,Width=13,Height=13}
F10: 11 - {X=241,Y=32,Width=13,Height=13}
F9: 10 - {X=220,Y=32,Width=13,Height=13}
F12: 73 - {X=278,Y=32,Width=13,Height=13}
F11: 12 - {X=260,Y=32,Width=13,Height=13}
PrintScreen: 74 - {X=302,Y=32,Width=13,Height=13}
ScrollLock: 75 - {X=322,Y=32,Width=13,Height=13}
PauseBreak: 76 - {X=341,Y=32,Width=13,Height=13}
PageUp: 79 - {X=341,Y=60,Width=13,Height=13}
Insert: 77 - {X=302,Y=60,Width=13,Height=13}
Home: 78 - {X=322,Y=60,Width=13,Height=13}
PageDown: 90 - {X=341,Y=79,Width=13,Height=13}
Delete: 88 - {X=302,Y=79,Width=13,Height=13}
End: 89 - {X=322,Y=79,Width=13,Height=13}
D1: 14 - {X=30,Y=60,Width=13,Height=13}
D2: 15 - {X=50,Y=60,Width=14,Height=13}
D3: 16 - {X=68,Y=60,Width=13,Height=13}
D4: 17 - {X=88,Y=60,Width=13,Height=13}
D5: 18 - {X=106,Y=60,Width=13,Height=13}
D6: 19 - {X=126,Y=60,Width=13,Height=13}
D7: 20 - {X=144,Y=60,Width=13,Height=13}
D0: 23 - {X=203,Y=60,Width=13,Height=13}
EqualsAndPlus: 85 - {X=241,Y=60,Width=13,Height=13}
MinusAndUnderscore: 24 - {X=222,Y=60,Width=13,Height=13}
D9: 22 - {X=184,Y=60,Width=13,Height=13}
D8: 21 - {X=164,Y=60,Width=13,Height=13}
T: 30 - {X=116,Y=79,Width=13,Height=13}
W: 27 - {X=58,Y=79,Width=13,Height=13}
U: 32 - {X=154,Y=79,Width=13,Height=13}
P: 35 - {X=212,Y=79,Width=13,Height=13}
Y: 31 - {X=136,Y=79,Width=13,Height=13}
BracketRight: 80 - {X=250,Y=79,Width=13,Height=13}
Q: 26 - {X=40,Y=79,Width=13,Height=13}
R: 29 - {X=98,Y=79,Width=13,Height=13}
O: 34 - {X=193,Y=79,Width=13,Height=13}
E: 28 - {X=78,Y=79,Width=13,Height=13}
BracketLeft: 36 - {X=231,Y=79,Width=13,Height=13}
I: 33 - {X=174,Y=79,Width=13,Height=13}
H: 43 - {X=140,Y=98,Width=13,Height=13}
S: 39 - {X=64,Y=98,Width=13,Height=13}
L: 46 - {X=198,Y=98,Width=13,Height=13}
D: 40 - {X=82,Y=98,Width=13,Height=13}
K: 45 - {X=178,Y=98,Width=13,Height=13}
J: 44 - {X=160,Y=98,Width=13,Height=13}
SemicolonAndColon: 47 - {X=216,Y=98,Width=13,Height=13}
ApostropheAndDoubleQuote: 48 - {X=235,Y=98,Width=13,Height=13}
G: 42 - {X=121,Y=98,Width=13,Height=13}
F: 41 - {X=102,Y=98,Width=13,Height=13}
A: 38 - {X=44,Y=98,Width=13,Height=13}
N: 56 - {X=150,Y=117,Width=13,Height=13}
C: 53 - {X=92,Y=117,Width=13,Height=13}
CommaAndLessThan: 58 - {X=188,Y=117,Width=13,Height=13}
V: 54 - {X=112,Y=117,Width=13,Height=13}
Z: 51 - {X=54,Y=117,Width=13,Height=13}
B: 55 - {X=130,Y=117,Width=13,Height=13}
X: 52 - {X=72,Y=117,Width=13,Height=13}
PeriodAndBiggerThan: 59 - {X=208,Y=117,Width=13,Height=13}
SlashAndQuestionMark: 60 - {X=228,Y=117,Width=13,Height=13}
M: 57 - {X=170,Y=117,Width=13,Height=13}
Tab: 25 - {X=10,Y=79,Width=22,Height=13}
CapsLock: 37 - {X=10,Y=98,Width=28,Height=13}
LeftShift: 49 - {X=10,Y=117,Width=38,Height=13}
LeftCtrl: 61 - {X=10,Y=137,Width=22,Height=13}
Enter: 83 - {X=256,Y=98,Width=35,Height=13}
RightShift: 91 - {X=247,Y=117,Width=44,Height=13}
Backslash: 81 - {X=270,Y=79,Width=22,Height=13}
Backspace: 87 - {X=260,Y=60,Width=31,Height=13}
LeftGui: 62 - {X=40,Y=137,Width=13,Height=13}
LeftAlt: 63 - {X=58,Y=137,Width=18,Height=13}
Space: 65 - {X=81,Y=137,Width=122,Height=13}
RightAlt: 68 - {X=208,Y=137,Width=18,Height=13}
Fn: 147 - {X=230,Y=137,Width=13,Height=13}
Application: 70 - {X=250,Y=137,Width=13,Height=13}
RightCtrl: 92 - {X=270,Y=137,Width=22,Height=13}
UpArrow: 93 - {X=322,Y=117,Width=13,Height=13}
LeftArrow: 94 - {X=302,Y=137,Width=13,Height=13}
DownArrow: 95 - {X=322,Y=137,Width=13,Height=13}
RightArrow: 96 - {X=341,Y=137,Width=13,Height=13}
NumLock: 103 - {X=367,Y=60,Width=13,Height=13}
KeypadSlash: 104 - {X=385,Y=60,Width=13,Height=13}
KeypadAsterisk: 105 - {X=405,Y=60,Width=13,Height=13}
KeypadMinus: 106 - {X=423,Y=60,Width=13,Height=13}
Keypad7: 109 - {X=367,Y=79,Width=13,Height=13}
Keypad8: 110 - {X=385,Y=79,Width=13,Height=13}
Keypad9: 111 - {X=405,Y=79,Width=13,Height=13}
Keypad4: 113 - {X=367,Y=98,Width=13,Height=13}
Keypad5: 114 - {X=385,Y=98,Width=13,Height=13}
Keypad6: 115 - {X=405,Y=98,Width=13,Height=13}
Keypad1: 116 - {X=367,Y=117,Width=13,Height=13}
Keypad2: 117 - {X=385,Y=117,Width=13,Height=13}
Keypad3: 118 - {X=405,Y=117,Width=13,Height=13}
KeypadPeriodAndDelete: 120 - {X=405,Y=137,Width=13,Height=13}
Keypad0: 119 - {X=367,Y=137,Width=31,Height=13}
KeypadPlus: 107 - {X=423,Y=79,Width=13,Height=33}
KeypadEnter: 108 - {X=423,Y=117,Width=13,Height=33}
Brightness: 72 - {X=402,Y=2,Width=16,Height=16}
WinLock: 97 - {X=420,Y=2,Width=16,Height=16}

@DarthAffe
Copy link
Owner

I don't get it - looks good as far as I can tell.
One last test. Please run

CueSDK.Initialize(true);
CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
keyboard.Brush = new SolidColorBrush(Color.Aqua);
keyboard.Update();
Thread.Sleep(5000);

All keys on the keyboard should be aqua then - how many/which ones stay black?

@antonpup
Copy link
Author

That turned the whole keyboard aqua. I then tried this:

CueSDK.Initialize(true);
CorsairKeyboard keyboard = CueSDK.KeyboardSDK;
keyboard[CorsairKeyboardKeyId.Brightness].Led.Color = Color.Aqua;
keyboard[CorsairKeyboardKeyId.Brightness].Led.IsLocked = true;
keyboard[CorsairKeyboardKeyId.WinLock].Led.Color = Color.Aqua;
keyboard[CorsairKeyboardKeyId.WinLock].Led.IsLocked = true;
keyboard.Update();
Thread.Sleep(5000);

And the two keys stayed aqua color, as opposed to previously black. But I don't lock any keys in my original code, so I don't see why they won't set to another color.

@DarthAffe
Copy link
Owner

ok - at least there is a way to make it work. With he code like this it should work without the lock too.
You could take the code that is verified to work and only remove the 'true' parameter from initialize. If it doesn't work after that you have something running (a second SDK-program or a special profile in CUE) which forces these buttons to be black.

@antonpup
Copy link
Author

Alright, problem resolved. Issue was on my side. My apologies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants