Skip to content

Commit 452ea9e

Browse files
Elteeb96Chr1sNo
authored andcommitted
Added rudimentary Z20 support, added icons for macro keys and ‘feature buttons’. I.E. The ‘game mode’ button on the Z20.
(cherry picked from commit 9d73df25fdc896a0363b2fe0e43aca13dd8663b6)
1 parent 45478b0 commit 452ea9e

File tree

4 files changed

+77
-3
lines changed

4 files changed

+77
-3
lines changed

Controllers/EVGAUSBController/EVGAKeyboardController.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include "EVGAKeyboardController.h"
1111

12-
static uint8_t packet_map[EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT] =
12+
static uint8_t packet_map[EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT + EVGA_KEYBOARD_Z20_EXTRA] =
1313
{
1414
/*00 ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 */
1515
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
@@ -43,6 +43,12 @@ static uint8_t packet_map[EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT] =
4343

4444
/*100 NM8 NM9 NM0 NM. PRV PLY NXT MTE */
4545
62, 63, 114, 115, 18, 19, 20, 118
46+
/*Macros+ GM M1 M2 M3 M4 M5 */
47+
, 0, 21, 43, 65, 82, 102,
48+
/*Left Lights L1 L2 L3 L4 L5 L6 L7 L8 L9 */
49+
160, 161, 162, 163, 164, 165, 166, 167, 168,
50+
/*Right Lights R1 R2 R3 R4 R5 R6 R7 R8 R9 */
51+
176, 177, 178, 179, 180, 181, 182, 183, 184
4652
};
4753

4854
EVGAKeyboardController::EVGAKeyboardController(hid_device* dev_handle, const char* path)

Controllers/EVGAUSBController/EVGAKeyboardController.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121
#define EVGA_KEYBOARD_CONTROLLER_ID_4_SIZE 17
2222
#define EVGA_KEYBOARD_CONTROLLER_ID_6_SIZE 792
2323
#define EVGA_KEYBOARD_CONTROLLER_ID_7_SIZE 136
24+
#define EVGA_KEYBOARD_CONTROLLER_ID_Z20_4_SIZE 35
25+
#define EVGA_KEYBOARD_CONTROLLER_ID_Z20_6_SIZE 828
26+
#define EVGA_KEYBOARD_CONTROLLER_ID_Z20_7_SIZE 187
2427
#define EVGA_KEYBOARD_CONTROLLER_INTERRUPT_TIMEOUT 250
2528

2629
#define EVGA_KEYBOARD_CONTROLLER_BRIGHTNESS_MIN 0
2730
#define EVGA_KEYBOARD_CONTROLLER_BRIGHTNESS_MAX 255
2831
#define EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT 108
29-
32+
#define EVGA_KEYBOARD_Z20_EXTRA 24
3033

3134
static const uint8_t direction_map[8][4] =
3235
{

Controllers/EVGAUSBController/EVGAUSBControllerDetect.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
\*-----------------------------------------------------*/
1515
#define Z15_ISO_PID 0x260E
1616
#define Z15_ANSI_PID 0x2608
17+
#define Z20_ANSI_PID 0x260A
1718

1819
void DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& name)
1920
{
@@ -33,3 +34,4 @@ void DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& nam
3334

3435
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ISO_PID, 1, 0x08, 0x4B);
3536
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ANSI_PID, 1, 0x08, 0x4B);
37+
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_ANSI_PID, 1, 0x08, 0x4B);

Controllers/EVGAUSBController/RGBController_EVGAKeyboard.cpp

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ static unsigned int full_matrix_map[6][21] =
2222
{ 76, 77, 78, NA, NA, NA, 79, NA, NA, NA, 80, 81, 82, 83, 84, 85, 86, 102, NA, 103, NA}
2323
};
2424

25+
static unsigned int Z20_right_side_matrix[1][9] =
26+
{
27+
{ 116, 118, 120, 122, 124, 126, 128, 130, 132}
28+
};
29+
30+
static unsigned int Z20_left_side_matrix[1][9] =
31+
{
32+
{ 115, 117, 119, 121, 123, 125, 127, 129, 131}
33+
};
34+
35+
static unsigned int Z20_macro_matrix[1][6] =
36+
{
37+
{109, 110, 111, 112, 113, 114}
38+
};
39+
2540
static const char *led_names[] =
2641
{
2742
KEY_EN_ESCAPE, // 00
@@ -139,6 +154,14 @@ static const char *led_names[] =
139154
KEY_EN_MEDIA_PLAY_PAUSE,
140155
KEY_EN_MEDIA_NEXT,
141156
KEY_EN_MEDIA_MUTE,
157+
},
158+
{
159+
"Key: Feature Button", "Key: Macro 1", "Key: Macro 2", "Key: Macro 3", "Key: Macro 4", "Key: Macro 5"
160+
},
161+
{
162+
"Key: Number Pad 1", "Key: Number Pad 2", "Key: Number Pad 3", "Key: Number Pad 4", "Key: Number Pad 5", "Key: Number Pad 6", "Key: Number Pad 7", "Key: Number Pad 8", "Key: Number Pad 9"},
163+
{
164+
"Key: Number Pad 1", "Key: Number Pad 2", "Key: Number Pad 3", "Key: Number Pad 4", "Key: Number Pad 5", "Key: Number Pad 6", "Key: Number Pad 7", "Key: Number Pad 8", "Key: Number Pad 9"},
142165
};
143166

144167
RGBController_EVGAKeyboard::RGBController_EVGAKeyboard(EVGAKeyboardController* controller_ptr)
@@ -355,7 +378,47 @@ void RGBController_EVGAKeyboard::SetupZones()
355378
KB_zone.matrix_map->width = 21;
356379
KB_zone.matrix_map->map = (unsigned int *)&full_matrix_map;
357380
zones.push_back(KB_zone);
358-
381+
if(controller->GetDeviceName() == "EVGA Corporation EVGA Z20 Elite Gaming Keyboard"){
382+
zone KB_right_sidelights;
383+
KB_right_sidelights.name = "Right Side Lights";
384+
KB_right_sidelights.type = 1;
385+
KB_right_sidelights.leds_min = 9;
386+
KB_right_sidelights.leds_max = 9;
387+
KB_right_sidelights.leds_count = 9;
388+
KB_right_sidelights.matrix_map = new matrix_map_type;
389+
390+
zone KB_left_sidelights;
391+
KB_left_sidelights.name = "Left Side Lights";
392+
KB_left_sidelights.type = 1;
393+
KB_left_sidelights.leds_min = 9;
394+
KB_left_sidelights.leds_max = 9;
395+
KB_left_sidelights.leds_count = 9;
396+
KB_left_sidelights.matrix_map = new matrix_map_type;
397+
398+
zone KB_macros;
399+
KB_macros.name = "Macros";
400+
KB_macros.type = 1;
401+
KB_macros.leds_min = 6;
402+
KB_macros.leds_max = 6;
403+
KB_macros.leds_count = 6;
404+
KB_macros.matrix_map = new matrix_map_type;
405+
406+
KB_right_sidelights.matrix_map->height = 1;
407+
KB_right_sidelights.matrix_map->width = 9;
408+
KB_right_sidelights.matrix_map->map = (unsigned int *)&Z20_right_side_matrix;
409+
410+
KB_left_sidelights.matrix_map->height = 1;
411+
KB_left_sidelights.matrix_map->width = 9;
412+
KB_left_sidelights.matrix_map->map = (unsigned int *)&Z20_right_side_matrix;
413+
414+
KB_macros.matrix_map->height = 1;
415+
KB_macros.matrix_map->width = 6;
416+
KB_macros.matrix_map->map = (unsigned int *)&Z20_macro_matrix;
417+
418+
zones.push_back(KB_macros);
419+
zones.push_back(KB_left_sidelights);
420+
zones.push_back(KB_right_sidelights);
421+
}
359422
/*-------------------------------------------------*\
360423
| Clear any existing color/LED configuration |
361424
\*-------------------------------------------------*/

0 commit comments

Comments
 (0)