Skip to content

Commit

Permalink
Merge pull request antonpup#1433 from drhead/qck-prism
Browse files Browse the repository at this point in the history
SteelSeries QcK Prism - Individual LED support.
  • Loading branch information
Gurjot95 authored Feb 5, 2019
2 parents bc49169 + fa850ad commit 6d559bc
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 4 deletions.
77 changes: 73 additions & 4 deletions Project-Aurora/Project-Aurora/Devices/SteelSeries/GameSenseSDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,27 @@ public void sendColor(String deviceType, byte red, byte green, byte blue)
sendPostRequest("http://" + sseAddress + "/game_event", json);
}

public void setMousepadColor(int zone, byte red, byte green, byte blue)
{
GameSensePayloadPeripheryColorEventJSON payload = new GameSensePayloadPeripheryColorEventJSON();
payload.game = sseGameName;
payload.Event = "COLOR";

List<string> zones = new List<string>(new string[] { "mpone", "mptwo", "mpthree", "mpfour", "mpfive", "mpsix", "mpseven", "mpeight", "mpnine", "mpten", "mpeleven", "mptwelve" });

payload.data = "{";
payload.data += "\"" + zones[zone - 1] + "\":{";
payload.data += "\"color\":";
payload.data += "[" + red + ", " + green + ", " + blue + "]";
payload.data += "}";
payload.data += "}";

// sending POST request
String json = JsonConvert.SerializeObject(payload);
sendPostRequest("http://" + sseAddress + "/game_event", json);

}

public void setKeyboardColors(List<byte> hids, List<Tuple<byte, byte, byte>> colors)
{
GameSensePayloadPeripheryColorEventJSON payload = new GameSensePayloadPeripheryColorEventJSON();
Expand Down Expand Up @@ -175,10 +196,58 @@ private void setupLISPHandlers()
(on-device ""rgb-2-zone"" show: color)
(on-device ""rgb-3-zone"" show: color)
(on-device ""rgb-4-zone"" show: color)
(on-device ""rgb-5-zone"" show: color)
(on-device ""rgb-12-zone"" show: color)))
(when (mouse:? data)
(on-device ""rgb-5-zone"" show: color)))
(when (mpone:? data)
(let* ((mpone (mpone: data))
(color (color: mpone)))
(on-device ""rgb-12-zone"" show-on-zone: color one:)))
(when (mptwo:? data)
(let* ((mptwo (mptwo: data))
(color (color: mptwo)))
(on-device ""rgb-12-zone"" show-on-zone: color two:)))
(when (mpthree:? data)
(let* ((mpthree (mpthree: data))
(color (color: mpthree)))
(on-device ""rgb-12-zone"" show-on-zone: color three:)))
(when (mpfour:? data)
(let* ((mpfour (mpfour: data))
(color (color: mpfour)))
(on-device ""rgb-12-zone"" show-on-zone: color four:)))
(when (mpfive:? data)
(let* ((mpfive (mpfive: data))
(color (color: mpfive)))
(on-device ""rgb-12-zone"" show-on-zone: color five:)))
(when (mpsix:? data)
(let* ((mpsix (mpsix: data))
(color (color: mpsix)))
(on-device ""rgb-12-zone"" show-on-zone: color six:)))
(when (mpseven:? data)
(let* ((mpseven (mpseven: data))
(color (color: mpseven)))
(on-device ""rgb-12-zone"" show-on-zone: color seven:)))
(when (mpeight:? data)
(let* ((mpeight (mpeight: data))
(color (color: mpeight)))
(on-device ""rgb-12-zone"" show-on-zone: color eight:)))
(when (mpnine:? data)
(let* ((mpnine (mpnine: data))
(color (color: mpnine)))
(on-device ""rgb-12-zone"" show-on-zone: color nine:)))
(when (mpten:? data)
(let* ((mpten (mpten: data))
(color (color: mpten)))
(on-device ""rgb-12-zone"" show-on-zone: color ten:)))
(when (mpeleven:? data)
(let* ((mpeleven (mpeleven: data))
(color (color: mpeleven)))
(on-device ""rgb-12-zone"" show-on-zone: color eleven:)))
(when (mptwelve:? data)
(let* ((mptwelve (mptwelve: data))
(color (color: mptwelve)))
(on-device ""rgb-12-zone"" show-on-zone: color twelve:)))
(when (mouse:? data)
(let* ((mouse (mouse: data))
(color (color: mouse)))
(on-device ""mouse"" show: color)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,54 @@ public bool UpdateDevice(Dictionary<DeviceKeys, Color> keyColors, DoWorkEventArg
SendColorToPeripheralZone(key.Key, color);
SendColorToPeripheral(color, forced);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT1)
{
gameSenseSDK.setMousepadColor(1, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT2)
{
gameSenseSDK.setMousepadColor(2, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT3)
{
gameSenseSDK.setMousepadColor(3, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT4)
{
gameSenseSDK.setMousepadColor(4, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT5)
{
gameSenseSDK.setMousepadColor(5, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT6)
{
gameSenseSDK.setMousepadColor(6, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT7)
{
gameSenseSDK.setMousepadColor(7, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT8)
{
gameSenseSDK.setMousepadColor(8, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT9)
{
gameSenseSDK.setMousepadColor(9, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT10)
{
gameSenseSDK.setMousepadColor(10, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT11)
{
gameSenseSDK.setMousepadColor(11, color.R, color.G, color.B);
}
else if (key.Key == DeviceKeys.MOUSEPADLIGHT12)
{
gameSenseSDK.setMousepadColor(12, color.R, color.G, color.B);
}
else
{
byte hid = GetHIDCode(key.Key);
Expand Down

0 comments on commit 6d559bc

Please sign in to comment.