mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-10-23 08:58:58 -04:00
Fixing missing keys in matrix map to resolve #1918
* Re-arranging `led_names` to have the numpad at the end to accomodate both full size and TKL variants - Removing redundant `led_names_tkl` from RGBController_SteelSeriesApex.cpp - Removing redundant `keys_tkl[]` from SteelSeriesApexController.cpp * adjusted matrix maps to index correct `led_names[]` * adjusted `keys[]`and `keys_m[]` for new indexing in colors[]`
This commit is contained in:
1 parent
6369968a31
commit
55269cff8a
3 files changed
+70
-174
No files matched your search
@@ -11,13 +11,28 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#define SS_APEX_M_PACKET_SIZE 513
|
||||
#define NA 0xFF
|
||||
static unsigned int keys_m[] = { 96, 99, 98, NA, 40, NA, NA, NA, NA, 102, 103, 104, 100, NA, NA , 75, 76, 74, NA, 93, NA, 94,
|
||||
97, 25, 23, 2 , 21, 1 , 13, 12, 49, 50 , 51 , NA , 101, NA, NA , NA, 77, NA, 84, 85, 86, 83,
|
||||
52, 0 , 18, 3 , 5 , 6 , 7 , 9 , 10, 11 , 46 , 47 , NA , 36, NA , NA, NA, NA, 87, 88, 89, NA,
|
||||
39, 16, 22, 4 , 17, 19, 24, 20, 8 , 14 , 15 , 43 , 44 , NA, 105, 71, 72, 73, 90, 91, 92, 82,
|
||||
48, 26, 27, 28, 29, 30, 31, 32, 33, 34 , 35 , 41 , 42 , NA, 38 , 68, 69, 70, 78, 79, 80, 81,
|
||||
37, 53, 54, 55, 56, NA, 57, 58, 59, 60 , NA , 61 , 62 , 63, 64 , 65, 66, 67, NA, NA, NA, NA };
|
||||
static unsigned int keys_m[] =
|
||||
{
|
||||
/* LCTRL LWIN LALT XXX SPACE XXX XXX XXX XXX RALT RWIN FNC RCTRL XXX XXX LEFT DOWN RIGHT XXX #0 XXX #. */
|
||||
79, 82, 81, NA, 40, NA, NA, NA, NA, 85, 86, 87, 83, NA, NA, 75, 76, 74, NA, 104, NA, 105,
|
||||
|
||||
/* LSHFT Z X C V B N M , . / XXX RSHFT XXX XXX XXX UP XXX #1 #2 #3 #ENTR */
|
||||
80, 25, 23, 2, 21, 1, 13, 12, 49, 50, 51, NA, 84, NA, NA, NA, 77, NA, 95, 96, 97, 94,
|
||||
|
||||
/* CAPLK A S D F G H J K L ; ' XXX ENTER XXX XXX XXX XXX #4 #5 #6 XXX */
|
||||
52, 0, 18, 3, 5, 6, 7, 9, 10, 11, 46, 47, NA, 36, NA, NA, NA, NA, 98, 99, 100, NA,
|
||||
|
||||
/* TAB Q W E R T Y U I O P [ ] XXX \ DELTE END PGDN #7 #8 #9 #+ */
|
||||
39, 16, 22, 4, 17, 19, 24, 20, 8, 14, 15, 43, 44, NA, 88, 71, 72, 73, 101, 102, 103, 93,
|
||||
|
||||
/* ` 1 2 3 4 5 6 7 8 9 0 - = XXX BKSPC INSRT HOME PGUP NUMLK #/ #* #- */
|
||||
48, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 41, 42, NA, 38, 68, 69, 70, 89, 90, 91, 92,
|
||||
|
||||
/* ESC F1 F2 F3 F4 XXX F5 F6 F7 F8 XXX F9 F10 F11 F12 PRTSC SCRLK PAUSE XXX XXX XXX XXX */
|
||||
37, 53, 54, 55, 56, NA, 57, 58, 59, 60, NA, 61, 62, 63, 64, 65, 66, 67, NA, NA, NA, NA
|
||||
};
|
||||
|
||||
SteelSeriesApexMController::SteelSeriesApexMController(hid_device* dev_handle, steelseries_type type, const char* path)
|
||||
{
|
||||
@@ -34,7 +49,8 @@ SteelSeriesApexMController::~SteelSeriesApexMController()
|
||||
|
||||
void SteelSeriesApexMController::EnableLEDControl()
|
||||
{
|
||||
unsigned char buf[513] = { 0x00 };
|
||||
unsigned char buf[SS_APEX_M_PACKET_SIZE] = { 0x00 };
|
||||
|
||||
buf[0x00] = 0x00;
|
||||
buf[0x01] = 0x00;
|
||||
buf[0x02] = 0x00;
|
||||
@@ -42,7 +58,8 @@ void SteelSeriesApexMController::EnableLEDControl()
|
||||
buf[0x04] = 0x01;
|
||||
buf[0x05] = 0x00;
|
||||
buf[0x06] = 0x85;
|
||||
hid_send_feature_report(dev, buf, 513);
|
||||
hid_send_feature_report(dev, buf, SS_APEX_M_PACKET_SIZE);
|
||||
|
||||
buf[0x00] = 0x00;
|
||||
buf[0x01] = 0x00;
|
||||
buf[0x02] = 0x00;
|
||||
@@ -51,7 +68,8 @@ void SteelSeriesApexMController::EnableLEDControl()
|
||||
buf[0x05] = 0x01;
|
||||
buf[0x06] = 0x00;
|
||||
buf[0x07] = 0xff;
|
||||
hid_send_feature_report(dev, buf, 513);
|
||||
hid_send_feature_report(dev, buf, SS_APEX_M_PACKET_SIZE);
|
||||
|
||||
buf[0x00] = 0x00;
|
||||
buf[0x01] = 0x00;
|
||||
buf[0x02] = 0x00;
|
||||
@@ -59,7 +77,7 @@ void SteelSeriesApexMController::EnableLEDControl()
|
||||
buf[0x04] = 0x01;
|
||||
buf[0x05] = 0x00;
|
||||
buf[0x06] = 0x85;
|
||||
hid_send_feature_report(dev, buf, 513);
|
||||
hid_send_feature_report(dev, buf, SS_APEX_M_PACKET_SIZE);
|
||||
}
|
||||
|
||||
void SteelSeriesApexMController::SetMode(unsigned char /*mode*/, std::vector<RGBColor> /*colors*/)
|
||||
@@ -68,7 +86,7 @@ void SteelSeriesApexMController::SetMode(unsigned char /*mode*/, std::vector<RGB
|
||||
|
||||
void SteelSeriesApexMController::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
{
|
||||
unsigned char buf[513] = { 0x00 };
|
||||
unsigned char buf[SS_APEX_M_PACKET_SIZE] = { 0x00 };
|
||||
int num_keys = sizeof(keys_m) / sizeof(*keys_m);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -91,21 +109,20 @@ void SteelSeriesApexMController::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
{
|
||||
if (keys_m[i] == NA)
|
||||
{
|
||||
buf[i * 3 + 9] = 0xFF;
|
||||
buf[i * 3 + 10] = 0x32;
|
||||
buf[i * 3 + 11] = 0x00;
|
||||
buf[i * 3 + 9] = 0xFF;
|
||||
buf[i * 3 + 10] = 0x32;
|
||||
buf[i * 3 + 11] = 0x00;
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[(i * 3) + 9] = RGBGetRValue(colors[keys_m[i]]);
|
||||
buf[(i * 3) + 10] = RGBGetGValue(colors[keys_m[i]]);
|
||||
buf[(i * 3) + 11] = RGBGetBValue(colors[keys_m[i]]);
|
||||
buf[(i * 3) + 9] = RGBGetRValue(colors[keys_m[i]]);
|
||||
buf[(i * 3) + 10] = RGBGetGValue(colors[keys_m[i]]);
|
||||
buf[(i * 3) + 11] = RGBGetBValue(colors[keys_m[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, buf, 513);
|
||||
|
||||
hid_send_feature_report(dev, buf, SS_APEX_M_PACKET_SIZE);
|
||||
}
|
||||
Reference in new issue
Block a user