mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-18 11:35:21 -04:00
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)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "EVGAKeyboardController.h"
|
||||
|
||||
static uint8_t packet_map[EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT] =
|
||||
static uint8_t packet_map[EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT + EVGA_KEYBOARD_Z20_EXTRA] =
|
||||
{
|
||||
/*00 ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 */
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
||||
@@ -43,6 +43,12 @@ static uint8_t packet_map[EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT] =
|
||||
|
||||
/*100 NM8 NM9 NM0 NM. PRV PLY NXT MTE */
|
||||
62, 63, 114, 115, 18, 19, 20, 118
|
||||
/*Macros+ GM M1 M2 M3 M4 M5 */
|
||||
, 0, 21, 43, 65, 82, 102,
|
||||
/*Left Lights L1 L2 L3 L4 L5 L6 L7 L8 L9 */
|
||||
160, 161, 162, 163, 164, 165, 166, 167, 168,
|
||||
/*Right Lights R1 R2 R3 R4 R5 R6 R7 R8 R9 */
|
||||
176, 177, 178, 179, 180, 181, 182, 183, 184
|
||||
};
|
||||
|
||||
EVGAKeyboardController::EVGAKeyboardController(hid_device* dev_handle, const char* path)
|
||||
|
||||
@@ -21,12 +21,15 @@
|
||||
#define EVGA_KEYBOARD_CONTROLLER_ID_4_SIZE 17
|
||||
#define EVGA_KEYBOARD_CONTROLLER_ID_6_SIZE 792
|
||||
#define EVGA_KEYBOARD_CONTROLLER_ID_7_SIZE 136
|
||||
#define EVGA_KEYBOARD_CONTROLLER_ID_Z20_4_SIZE 35
|
||||
#define EVGA_KEYBOARD_CONTROLLER_ID_Z20_6_SIZE 828
|
||||
#define EVGA_KEYBOARD_CONTROLLER_ID_Z20_7_SIZE 187
|
||||
#define EVGA_KEYBOARD_CONTROLLER_INTERRUPT_TIMEOUT 250
|
||||
|
||||
#define EVGA_KEYBOARD_CONTROLLER_BRIGHTNESS_MIN 0
|
||||
#define EVGA_KEYBOARD_CONTROLLER_BRIGHTNESS_MAX 255
|
||||
#define EVGA_KEYBOARD_FULL_SIZE_KEYCOUNT 108
|
||||
|
||||
#define EVGA_KEYBOARD_Z20_EXTRA 24
|
||||
|
||||
static const uint8_t direction_map[8][4] =
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
\*-----------------------------------------------------*/
|
||||
#define Z15_ISO_PID 0x260E
|
||||
#define Z15_ANSI_PID 0x2608
|
||||
#define Z20_ANSI_PID 0x260A
|
||||
|
||||
void DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
@@ -33,3 +34,4 @@ void DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& nam
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ISO_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ANSI_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_ANSI_PID, 1, 0x08, 0x4B);
|
||||
|
||||
@@ -22,6 +22,21 @@ static unsigned int full_matrix_map[6][21] =
|
||||
{ 76, 77, 78, NA, NA, NA, 79, NA, NA, NA, 80, 81, 82, 83, 84, 85, 86, 102, NA, 103, NA}
|
||||
};
|
||||
|
||||
static unsigned int Z20_right_side_matrix[1][9] =
|
||||
{
|
||||
{ 116, 118, 120, 122, 124, 126, 128, 130, 132}
|
||||
};
|
||||
|
||||
static unsigned int Z20_left_side_matrix[1][9] =
|
||||
{
|
||||
{ 115, 117, 119, 121, 123, 125, 127, 129, 131}
|
||||
};
|
||||
|
||||
static unsigned int Z20_macro_matrix[1][6] =
|
||||
{
|
||||
{109, 110, 111, 112, 113, 114}
|
||||
};
|
||||
|
||||
static const char *led_names[] =
|
||||
{
|
||||
KEY_EN_ESCAPE, // 00
|
||||
@@ -139,6 +154,14 @@ static const char *led_names[] =
|
||||
KEY_EN_MEDIA_PLAY_PAUSE,
|
||||
KEY_EN_MEDIA_NEXT,
|
||||
KEY_EN_MEDIA_MUTE,
|
||||
},
|
||||
{
|
||||
"Key: Feature Button", "Key: Macro 1", "Key: Macro 2", "Key: Macro 3", "Key: Macro 4", "Key: Macro 5"
|
||||
},
|
||||
{
|
||||
"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"},
|
||||
{
|
||||
"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"},
|
||||
};
|
||||
|
||||
RGBController_EVGAKeyboard::RGBController_EVGAKeyboard(EVGAKeyboardController* controller_ptr)
|
||||
@@ -355,7 +378,47 @@ void RGBController_EVGAKeyboard::SetupZones()
|
||||
KB_zone.matrix_map->width = 21;
|
||||
KB_zone.matrix_map->map = (unsigned int *)&full_matrix_map;
|
||||
zones.push_back(KB_zone);
|
||||
if(controller->GetDeviceName() == "EVGA Corporation EVGA Z20 Elite Gaming Keyboard"){
|
||||
zone KB_right_sidelights;
|
||||
KB_right_sidelights.name = "Right Side Lights";
|
||||
KB_right_sidelights.type = 1;
|
||||
KB_right_sidelights.leds_min = 9;
|
||||
KB_right_sidelights.leds_max = 9;
|
||||
KB_right_sidelights.leds_count = 9;
|
||||
KB_right_sidelights.matrix_map = new matrix_map_type;
|
||||
|
||||
zone KB_left_sidelights;
|
||||
KB_left_sidelights.name = "Left Side Lights";
|
||||
KB_left_sidelights.type = 1;
|
||||
KB_left_sidelights.leds_min = 9;
|
||||
KB_left_sidelights.leds_max = 9;
|
||||
KB_left_sidelights.leds_count = 9;
|
||||
KB_left_sidelights.matrix_map = new matrix_map_type;
|
||||
|
||||
zone KB_macros;
|
||||
KB_macros.name = "Macros";
|
||||
KB_macros.type = 1;
|
||||
KB_macros.leds_min = 6;
|
||||
KB_macros.leds_max = 6;
|
||||
KB_macros.leds_count = 6;
|
||||
KB_macros.matrix_map = new matrix_map_type;
|
||||
|
||||
KB_right_sidelights.matrix_map->height = 1;
|
||||
KB_right_sidelights.matrix_map->width = 9;
|
||||
KB_right_sidelights.matrix_map->map = (unsigned int *)&Z20_right_side_matrix;
|
||||
|
||||
KB_left_sidelights.matrix_map->height = 1;
|
||||
KB_left_sidelights.matrix_map->width = 9;
|
||||
KB_left_sidelights.matrix_map->map = (unsigned int *)&Z20_right_side_matrix;
|
||||
|
||||
KB_macros.matrix_map->height = 1;
|
||||
KB_macros.matrix_map->width = 6;
|
||||
KB_macros.matrix_map->map = (unsigned int *)&Z20_macro_matrix;
|
||||
|
||||
zones.push_back(KB_macros);
|
||||
zones.push_back(KB_left_sidelights);
|
||||
zones.push_back(KB_right_sidelights);
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Clear any existing color/LED configuration |
|
||||
\*-------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user