These are chat archives for CoraleStudios/Colore

3rd
Feb 2016
PsychoTea
@PsychoTea
Feb 03 2016 10:17
Alright I got a question. Why is it that when using keyboard.SetKeys you have to define a key aswell as an array of keys? Eg keyboard.Setkeys(Color.Green, Key.A, new string3 { Key.B, Key.C, Key.D }); rather than just keyboard.SetKeys(Color.Green, new string4 { Key.A, Key.B, Key.C, Key.D });
Adam Hellberg
@Sharparam
Feb 03 2016 11:36
there is no overload of SetKeys that takes a "string3" or "string4" type so I'm not sure where those are from. The SetKeys(Color, Key, params Key[]) takes an initial key and a variable number of additional keys to set using normal params syntax which means they can either be supplied as regular additional arguments ex: SetKeys(Color.Red, Key.Enter, Key.Escape, Key.F) or an array of keys ex: SetKeys(Color.Red, Key.Enter, new[] { Key.Escape, Key.F })
PsychoTea
@PsychoTea
Feb 03 2016 11:38
Ah okay that makes more sense. The string3 string4 thing seems to be a automatic formatting thing that was done when I sent the message. it was meant to say "string [ 4 ]"
PsychoTea
@PsychoTea
Feb 03 2016 12:34
Is there any way to change the type of System.Windows.Forms.Keys to Corale.Colore.Razer.Keyboard.Key ?
Adam Hellberg
@Sharparam
Feb 03 2016 12:35
not built-in
you'll have to create your own mapping
PsychoTea
@PsychoTea
Feb 03 2016 12:35
Fuck
Has anyone made one or will I have to write my own
Adam Hellberg
@Sharparam
Feb 03 2016 12:35
we decided against including such a thing in colore because the maintenance cost is too high and there's no good conversion scheme to use
PsychoTea
@PsychoTea
Feb 03 2016 12:35
Damn
Adam Hellberg
@Sharparam
Feb 03 2016 12:35
i made one for Whack-a-Mole, lemme see if i can find the file
PsychoTea
@PsychoTea
Feb 03 2016 12:35
Any easy way to get a C.C.R.Keyboard.Key type from a KeyDown event?
Adam Hellberg
@Sharparam
Feb 03 2016 12:36
it's WPF though, but it might serve as a guide
PsychoTea
@PsychoTea
Feb 03 2016 12:40
Thankyou
Oh man this makes me cry. Did you do the whole thing manually?
Adam Hellberg
@Sharparam
Feb 03 2016 12:43
manually-ish
regex is a powerful tool :3
PsychoTea
@PsychoTea
Feb 03 2016 12:43
ah i see
I appreciate it tho
Adam Hellberg
@Sharparam
Feb 03 2016 12:44
the keymap can probably almost be copied straight off, only changing the using statement to the forms namespace instead, as i think WPF and Windows Forms use the same names in their key enums
PsychoTea
@PsychoTea
Feb 03 2016 12:45
Yup. I'll give it a go.
PsychoTea
@PsychoTea
Feb 03 2016 12:51
I think it's binding each chroma key to a chroma key lol, let me do some F&R
PsychoTea
@PsychoTea
Feb 03 2016 13:00
Oh crap. KeyMap.Get() does Rz key -> Sys key. I need it the other way round... Do I just change return (ChromaKey) to return (Keys) in KeyMap.Get?
PsychoTea
@PsychoTea
Feb 03 2016 13:13
Never mind - got it. Now having problems with checking if the key exists. :(
Adam Hellberg
@Sharparam
Feb 03 2016 13:23
the Get in the gist converts system key to chroma key
PsychoTea
@PsychoTea
Feb 03 2016 13:24
Yeah I think I had something backwards. it's sorted now. But I'm having an issue with Contains (from the gist) which will throw an exception
Adam Hellberg
@Sharparam
Feb 03 2016 13:25
what exception
PsychoTea
@PsychoTea
Feb 03 2016 13:25
of type 'System.TypeInitalizationException;
the type initalizer for 'RazerChromaTest.FullkeyMap' threw an exception
Happens when I press any key and it falls through to
'''
'''
if (FullKeyMap.Contains(e.KeyValue))
'''
wrong key lol,
if (FullKeyMap.Contains(e.KeyValue))
Adam Hellberg
@Sharparam
Feb 03 2016 13:28
what is the actual exception (that is thrown by the type initializer), it should be in the inner exception property probably
PsychoTea
@PsychoTea
Feb 03 2016 13:32
Sorry I'm not amazing at C# - where would I find that?
PsychoTea
@PsychoTea
Feb 03 2016 13:38
Figured it out now, I had "Alt" in the KeyMap twice
PsychoTea
@PsychoTea
Feb 03 2016 13:49
What's the ChromaKey code for ` (grave accent)?
I've got 3 keys returning ControlKey (System.Windows.Forms.Keys), but putting them all in seperate entires in the hash will throw the error I just had, how should I handle that?
Adam Hellberg
@Sharparam
Feb 03 2016 13:52
a hash table is unique, so every key can only occur once
the grave accent is probably one of the Oem* entries
PsychoTea
@PsychoTea
Feb 03 2016 13:53
What if I have multiple values for a key?
Adam Hellberg
@Sharparam
Feb 03 2016 13:53
which one has multiple?
PsychoTea
@PsychoTea
Feb 03 2016 13:53
It's Oem7 I think but I'm not sure what the chromakey equivalent is
ControlKey has 3
Adam Hellberg
@Sharparam
Feb 03 2016 13:54
there's no clear documentation on what each of the Oem with a number after mean, so it's more or less impossible to find out
PsychoTea
@PsychoTea
Feb 03 2016 13:56
private void Form1_KeyDown(object sender, KeyEventArgs e)
if (!(FullKeyMap.Contains(e.KeyCode))) MessageBox.Show(e.KeyCode.ToString());
According to that code grave accent is Oem8
PsychoTea
@PsychoTea
Feb 03 2016 14:18
Looks like M$ have done a really shitty job here; 2 different keys will return the same KeyCode and KeyValue, which is OK for normal forms stuff, but when you need the individual key it's not good. I may be using the wrong event tho
PsychoTea
@PsychoTea
Feb 03 2016 14:24
How would I detect when a macro key or the function key is pressed?
PsychoTea
@PsychoTea
Feb 03 2016 14:39
Also, do you know how I could run the Wave effect on a single key? Is there any example code of this anywhere?
Adam Hellberg
@Sharparam
Feb 03 2016 15:02
don't think macro keys can be detected
PsychoTea
@PsychoTea
Feb 03 2016 15:03
okay
How about the wave effect on a single key?
Adam Hellberg
@Sharparam
Feb 03 2016 15:04
you'd have to write code to change the color of a single key with some interval
it would just look like a spectrum thing though since a wave effect on a single key isn't a wave
PsychoTea
@PsychoTea
Feb 03 2016 15:04
In that case, how does C.C.R.Keyboard.Effects.Custom work? What's it for?
Good point.
Adam Hellberg
@Sharparam
Feb 03 2016 15:11
custom is for setting custom colors on individual keys rather than using the pre-defined effects
PsychoTea
@PsychoTea
Feb 03 2016 15:13
Isn't that what .SetKey(s) does?
Adam Hellberg
@Sharparam
Feb 03 2016 15:19
SetKey uses an internal custom effect for managing the keys
PsychoTea
@PsychoTea
Feb 03 2016 15:20
Ah okay
Woah this is really weird
My multiply and divide are being set to a different colour then the other numpad keys... O.o It was working fine a minute ago...
PsychoTea
@PsychoTea
Feb 03 2016 16:02
Shit... Somehow a bunch of my Red LED's on my numpad aren't working anymore! Any ideas? Gonna try googling around and restarting etc... Hope they aren't broken :/
Ahhh don't worry :3 must've been a bug or something cus I replugged my KB and they're working now... Thank fuck
Adam Hellberg
@Sharparam
Feb 03 2016 17:29
i don't know the internals of the hardware but i'm pretty sure they use RGB LEDs and not three separate red green and blue LEDs
PsychoTea
@PsychoTea
Feb 03 2016 17:30
Oh I see
Do you have any idea on how to use Colore to integrate a chroma device into a game such as League of Legends or Minecraft?
Adam Hellberg
@Sharparam
Feb 03 2016 17:32
you'd need something to extract and track state in the game and have your app light keys up depending on the state/events of the game
PsychoTea
@PsychoTea
Feb 03 2016 17:32
Damn
I have no idea how to do that lol
@Sharparam That's an overkill as fck with this enum. :D
warning, crapcode
Dariusz Niemczyk
@Palid
Feb 03 2016 21:04
@PsychoTea I had the same problem a lot of times in Simon Says. Replugging keyboard fixes the leds.
It's probably due to the crappy, crappy Razer software
Adam Hellberg
@Sharparam
Feb 03 2016 22:33
@Palid You're making assumptions in your code that there will always be a direct mapping between the names of razer keys and the names of keyboard keys, which is not always the case when going into keys that are less standardized and depending on layout (the various Oem keys and keys that move around in various layouts like anything that isn't a number, letter, numpad, or function key)
which is why we haven't implemented a conversion method in colore itself due to way too many variables and inconsistencies