Update to add Apex Pro keyboard

This commit is contained in:
edbgon
2020-08-07 13:27:19 +02:00
committed by Adam Honse
parent c571ea124f
commit 3da5a4f6ba
5 changed files with 16 additions and 14 deletions

View File

@@ -61,7 +61,7 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector<RGBColor> colors)
unsigned char buf[643];
int num_keys = 0;
if(proto_type == APEX_7)
if(proto_type == APEX)
{
num_keys = sizeof(keys) / sizeof(*keys);
}
@@ -79,7 +79,7 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector<RGBColor> colors)
| Set up Direct packet |
\*-----------------------------------------------------*/
buf[0x00] = 0;
buf[0x01] = APEX7_PACKET_ID_DIRECT;
buf[0x01] = APEX_PACKET_ID_DIRECT;
buf[0x02] = num_keys;
/*-----------------------------------------------------*\
@@ -87,7 +87,7 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector<RGBColor> colors)
\*-----------------------------------------------------*/
for(int i = 0; i < num_keys; i++)
{
if(proto_type == APEX_7)
if(proto_type == APEX)
{
buf[(i*4)+3] = keys[i];
}

View File

@@ -17,7 +17,7 @@
enum
{
APEX7_PACKET_ID_DIRECT = 0x3a, /* Direct mode */
APEX_PACKET_ID_DIRECT = 0x3a, /* Direct mode */
};
class SteelSeriesApexController

View File

@@ -38,6 +38,7 @@
\*-----------------------------------------------------*/
#define STEELSERIES_APEX_7_PID 0x1612
#define STEELSERIES_APEX_7_TKL_PID 0x1618
#define STEELSERIES_APEX_PRO_PID 0x1610
typedef struct
{
@@ -75,8 +76,9 @@ static const steelseries_device device_list[] =
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------*\
| Keyboards |
\*-----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
{ STEELSERIES_VID, STEELSERIES_APEX_7_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_7, "SteelSeries Apex 7" },
{ STEELSERIES_VID, STEELSERIES_APEX_7_TKL_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_7_TKL, "SteelSeries Apex 7 TKL" },
{ STEELSERIES_VID, STEELSERIES_APEX_7_PID, 1, DEVICE_TYPE_KEYBOARD, APEX, "SteelSeries Apex 7" },
{ STEELSERIES_VID, STEELSERIES_APEX_7_TKL_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_TKL, "SteelSeries Apex 7 TKL" },
{ STEELSERIES_VID, STEELSERIES_APEX_PRO_PID, 1, DEVICE_TYPE_KEYBOARD, APEX, "SteelSeries Apex Pro" },
};
/******************************************************************************************\

View File

@@ -20,7 +20,7 @@ typedef enum
RIVAL_100 = 0x00,
RIVAL_300 = 0x01,
SIBERIA_350 = 0x03,
APEX_7 = 0x04,
APEX_7_TKL = 0x05,
APEX = 0x04,
APEX_TKL = 0x05,
} steelseries_type;

View File

@@ -263,9 +263,9 @@ RGBController_SteelSeriesApex::RGBController_SteelSeriesApex(SteelSeriesApexCont
{
steelseries = steelseries_ptr;
name = "SteelSeries Apex 7 RGB Keyboard";
name = "SteelSeries Apex RGB Keyboard";
type = DEVICE_TYPE_KEYBOARD;
description = "SteelSeries Apex 7 RGB Device";
description = "SteelSeries Apex RGB Device";
proto_type = steelseries->proto_type;
@@ -297,7 +297,7 @@ void RGBController_SteelSeriesApex::SetupZones()
new_zone.name = zone_names[zone_idx];
new_zone.type = zone_types[zone_idx];
if(proto_type == APEX_7)
if(proto_type == APEX)
{
new_zone.leds_min = zone_sizes[zone_idx];
new_zone.leds_max = zone_sizes[zone_idx];
@@ -314,7 +314,7 @@ void RGBController_SteelSeriesApex::SetupZones()
{
new_zone.matrix_map = new matrix_map_type;
new_zone.matrix_map->height = 6;
if(proto_type == APEX_7)
if(proto_type == APEX)
{
new_zone.matrix_map->width = 23;
new_zone.matrix_map->map = (unsigned int *)&matrix_map;
@@ -332,7 +332,7 @@ void RGBController_SteelSeriesApex::SetupZones()
zones.push_back(new_zone);
if(proto_type == APEX_7)
if(proto_type == APEX)
{
total_led_count += zone_sizes[zone_idx];
}
@@ -345,7 +345,7 @@ void RGBController_SteelSeriesApex::SetupZones()
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
{
led new_led;
if(proto_type == APEX_7)
if(proto_type == APEX)
{
new_led.name = led_names[led_idx];
}