Add support for ZET Fury Pro
This commit is contained in:
parent
be15e5a1cf
commit
3bcfa7cc7e
7 changed files with 534 additions and 12 deletions
|
|
@ -732,10 +732,12 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="5702", TAG+="uacces
|
|||
# Glorious Model O / O- #
|
||||
# Glorious Model D / D- #
|
||||
# Everest GT-100 RGB #
|
||||
# ZET Fury Pro #
|
||||
#---------------------------------------------------------------#
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="258a", ATTR{idProduct}=="0036", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="258a", ATTR{idProduct}=="0033", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="258a", ATTR{idProduct}=="0029", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="258a", ATTR{idProduct}=="1007", TAG+="uaccess"
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# Sony Devices #
|
||||
|
|
|
|||
|
|
@ -0,0 +1,246 @@
|
|||
/*-------------------------------------------*\
|
||||
| RGBController_Sinowealth1007.cpp |
|
||||
| |
|
||||
| Generic RGB Interface for Sinowealth |
|
||||
| mice with PID 1007 and similar controllers |
|
||||
| |
|
||||
| Moon_darker (Vaker) 02.02.2022 |
|
||||
\*-------------------------------------------*/
|
||||
|
||||
#include "RGBController_Sinowealth1007.h"
|
||||
|
||||
static const char *led_names[] =
|
||||
{
|
||||
"Top Left",
|
||||
"Middle Left",
|
||||
"Bottom Left",
|
||||
"Bottom Middle",
|
||||
"Bottom Right",
|
||||
"Middle Right",
|
||||
"Top Right"
|
||||
};
|
||||
|
||||
RGBController_Sinowealth1007::RGBController_Sinowealth1007(SinowealthController1007* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "ZET Fury Pro Mouse Device";
|
||||
vendor = "ZET";
|
||||
type = DEVICE_TYPE_MOUSE;
|
||||
description = "ZET Fury Pro Mouse Device";
|
||||
location = controller->GetLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Custom;
|
||||
Custom.name = "Custom";
|
||||
Custom.value = ZET_FURY_PRO_MODE_CUSTOM;
|
||||
Custom.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Custom.color_mode = MODE_COLORS_PER_LED;
|
||||
Custom.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
modes.push_back(Custom);
|
||||
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = ZET_FURY_PRO_MODE_OFF;
|
||||
Off.flags = MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
Off.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
Off.brightness = ZET_FURY_PRO_BRIGHTNESS_DEF;
|
||||
modes.push_back(Off);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow Wave";
|
||||
Rainbow.value = ZET_FURY_PRO_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Rainbow.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Rainbow.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
Rainbow.direction = MODE_DIRECTION_RIGHT;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = ZET_FURY_PRO_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.brightness_min = ZET_FURY_PRO_BRIGHTNESS_MIN;
|
||||
Static.brightness_max = ZET_FURY_PRO_BRIGHTNESS_MAX;
|
||||
Static.brightness = ZET_FURY_PRO_BRIGHTNESS_DEF;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(Static.colors_max);
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ZET_FURY_PRO_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Breathing.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Breathing.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
Breathing.colors_min = 7;
|
||||
Breathing.colors_max = 7;
|
||||
Breathing.colors.resize(Breathing.colors_max);
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Pendulum;
|
||||
Pendulum.name = "Pendulum";
|
||||
Pendulum.value = ZET_FURY_PRO_MODE_PENDULUM;
|
||||
Pendulum.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_SPEED;
|
||||
Pendulum.color_mode = MODE_COLORS_NONE;
|
||||
Pendulum.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Pendulum.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Pendulum.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
modes.push_back(Pendulum);
|
||||
|
||||
mode Spectrum;
|
||||
Spectrum.name = "Spectrum Cycle";
|
||||
Spectrum.value = ZET_FURY_PRO_MODE_SPECTRUM;
|
||||
Spectrum.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_SPEED;
|
||||
Spectrum.color_mode = MODE_COLORS_NONE;
|
||||
Spectrum.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Spectrum.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Spectrum.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
modes.push_back(Spectrum);
|
||||
|
||||
mode TwoColors;
|
||||
TwoColors.name = "Two Colors"; // Should this be called "Flashing Two Colors" or smth like that maybe? Rapidly changes between 2 colors
|
||||
TwoColors.value = ZET_FURY_PRO_MODE_TWO_COLORS;
|
||||
TwoColors.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
TwoColors.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
TwoColors.colors_min = 2;
|
||||
TwoColors.colors_max = 2;
|
||||
TwoColors.colors.resize(TwoColors.colors_max);
|
||||
modes.push_back(TwoColors);
|
||||
|
||||
mode Reactive;
|
||||
Reactive.name = "Reactive";
|
||||
Reactive.value = ZET_FURY_PRO_MODE_REACTIVE;
|
||||
Reactive.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_SPEED;
|
||||
Reactive.color_mode = MODE_COLORS_RANDOM;
|
||||
Reactive.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Reactive.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Reactive.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
Reactive.colors_min = 7;
|
||||
Reactive.colors_max = 7;
|
||||
Reactive.colors.resize(Reactive.colors_max);
|
||||
modes.push_back(Reactive);
|
||||
|
||||
mode Flicker;
|
||||
Flicker.name = "Flicker"; // One color fluctuates around max brightness for some time, then changes to another
|
||||
Flicker.value = ZET_FURY_PRO_MODE_FLICKER;
|
||||
Flicker.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
|
||||
Flicker.color_mode = MODE_COLORS_NONE;
|
||||
Flicker.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Flicker.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Flicker.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
Flicker.direction = MODE_DIRECTION_RIGHT;
|
||||
modes.push_back(Flicker);
|
||||
|
||||
mode Rain;
|
||||
Rain.name = "Rain"; // More like bad LSD trip
|
||||
Rain.value = ZET_FURY_PRO_MODE_RAIN;
|
||||
Rain.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_SPEED;
|
||||
Rain.color_mode = MODE_COLORS_NONE;
|
||||
Rain.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Rain.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Rain.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
modes.push_back(Rain);
|
||||
|
||||
mode Snake;
|
||||
Snake.name = "Snake";
|
||||
Snake.value = ZET_FURY_PRO_MODE_SNAKE;
|
||||
Snake.flags = MODE_FLAG_AUTOMATIC_SAVE | MODE_FLAG_HAS_SPEED;
|
||||
Snake.color_mode = MODE_COLORS_NONE;
|
||||
Snake.speed_min = ZET_FURY_PRO_SPEED_MIN;
|
||||
Snake.speed_max = ZET_FURY_PRO_SPEED_MAX;
|
||||
Snake.speed = ZET_FURY_PRO_SPEED_DEF;
|
||||
modes.push_back(Snake);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_Sinowealth1007::~RGBController_Sinowealth1007()
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_Sinowealth1007::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Create a single zone |
|
||||
\*---------------------------------------------------------*/
|
||||
zone new_zone;
|
||||
new_zone.name = "Mouse";
|
||||
new_zone.type = ZONE_TYPE_LINEAR;
|
||||
new_zone.leds_min = controller->GetLEDCount();
|
||||
new_zone.leds_max = controller->GetLEDCount();
|
||||
new_zone.leds_count = controller->GetLEDCount();
|
||||
new_zone.matrix_map = NULL;
|
||||
zones.push_back(new_zone);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*---------------------------------------------------------*/
|
||||
for (unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = led_names[led_idx];
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_Sinowealth1007::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_Sinowealth1007::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetLEDColors(colors);
|
||||
}
|
||||
|
||||
void RGBController_Sinowealth1007::UpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_Sinowealth1007::UpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_Sinowealth1007::SetCustomMode()
|
||||
{
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
void RGBController_Sinowealth1007::DeviceUpdateMode()
|
||||
|
||||
{
|
||||
unsigned char random = (modes[active_mode].flags & MODE_FLAG_HAS_RANDOM_COLOR) ? ZET_FURY_PRO_SUBMODE_SET_COLOR : 0x00;
|
||||
random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM) ? ZET_FURY_PRO_SUBMODE_RANDOM : random;
|
||||
|
||||
if (modes[active_mode].value == ZET_FURY_PRO_MODE_BREATHING)
|
||||
{
|
||||
random = ZET_FURY_PRO_SUBMODE_SET_COLOR; // An unfortunate exception that has no random option but requires this
|
||||
}
|
||||
|
||||
if (!(modes[active_mode].flags & MODE_FLAG_HAS_DIRECTION_LR))
|
||||
{
|
||||
modes[active_mode].direction = MODE_DIRECTION_RIGHT; // Left and right are backwards, and we don't want to always append 0x80
|
||||
}
|
||||
|
||||
controller->SetMode(modes[active_mode].value,
|
||||
(modes[active_mode].speed ? modes[active_mode].speed : modes[active_mode].brightness),
|
||||
modes[active_mode].direction ? ZET_FURY_PRO_DIR_RIGHT : ZET_FURY_PRO_DIR_LEFT,
|
||||
modes[active_mode].colors,
|
||||
random,
|
||||
(modes[active_mode].color_mode == MODE_COLORS_PER_LED));
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/*-------------------------------------------*\
|
||||
| RGBController_Sinowealth1007.h |
|
||||
| |
|
||||
| Generic RGB Interface for Sinowealth |
|
||||
| mice with PID 1007 and similar controllers |
|
||||
| |
|
||||
| Moon_darker (Vaker) 25.01.2022 |
|
||||
\*-------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "SinowealthController1007.h"
|
||||
|
||||
class RGBController_Sinowealth1007 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_Sinowealth1007(SinowealthController1007* controller_ptr);
|
||||
~RGBController_Sinowealth1007();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void SetCustomMode();
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
|
||||
private:
|
||||
SinowealthController1007* controller;
|
||||
};
|
||||
123
Controllers/SinowealthController/SinowealthController1007.cpp
Normal file
123
Controllers/SinowealthController/SinowealthController1007.cpp
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
/*-----------------------------------------*\
|
||||
| SinowealthController1007.cpp |
|
||||
| |
|
||||
| Driver for Sinowealth mice with PID 1007 |
|
||||
| and ones with similar protocol |
|
||||
| |
|
||||
| Moon_darker (Vaker) 02.02.2022 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "SinowealthController1007.h"
|
||||
#include <cstring>
|
||||
#include <LogManager.h>
|
||||
|
||||
SinowealthController1007::SinowealthController1007(hid_device* dev, char *_path)
|
||||
{
|
||||
this->dev = dev;
|
||||
|
||||
this->led_count = 7;
|
||||
|
||||
this->current_mode = ZET_FURY_PRO_MODE_CUSTOM + ZET_FURY_PRO_SPEED_DEF;
|
||||
this->current_direction = ZET_FURY_PRO_DIR_RIGHT;
|
||||
|
||||
this->location = _path;
|
||||
memset(device_colors, 0x00, sizeof(device_colors));
|
||||
}
|
||||
|
||||
SinowealthController1007::~SinowealthController1007()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string SinowealthController1007::GetLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
unsigned int SinowealthController1007::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
}
|
||||
|
||||
std::string SinowealthController1007::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if (ret != 0)
|
||||
{
|
||||
return("");
|
||||
}
|
||||
|
||||
std::wstring return_wstring = serial_string;
|
||||
std::string return_string(return_wstring.begin(), return_wstring.end());
|
||||
|
||||
return(return_string);
|
||||
}
|
||||
|
||||
void SinowealthController1007::SetLEDColors(const std::vector<RGBColor>& colors)
|
||||
{
|
||||
memset(device_colors, 0x00, sizeof(device_colors));
|
||||
|
||||
unsigned int color_counter = 0;
|
||||
for (RGBColor color: colors)
|
||||
{
|
||||
unsigned int pkt_pointer = (color_counter * 3); // 3 bytes per color
|
||||
|
||||
device_colors[pkt_pointer] = RGBGetRValue(color);
|
||||
device_colors[pkt_pointer + 1] = RGBGetGValue(color);
|
||||
device_colors[pkt_pointer + 2] = RGBGetBValue(color);
|
||||
|
||||
if (++color_counter == 7) break;
|
||||
}
|
||||
|
||||
SendPacket();
|
||||
}
|
||||
|
||||
void SinowealthController1007::SetMode(
|
||||
unsigned char mode,
|
||||
unsigned char spd_or_lum,
|
||||
unsigned char direction,
|
||||
const std::vector<RGBColor>& colors,
|
||||
unsigned char random,
|
||||
bool has_per_led_colors)
|
||||
{
|
||||
current_mode = mode + (spd_or_lum ? spd_or_lum : ZET_FURY_PRO_SPEED_DEF);
|
||||
current_direction = random ? random : direction;
|
||||
|
||||
if (!has_per_led_colors)
|
||||
{
|
||||
memset(device_colors, 0x00, sizeof(device_colors));
|
||||
SetLEDColors(colors);
|
||||
}
|
||||
}
|
||||
|
||||
void SinowealthController1007::SendPacket()
|
||||
{
|
||||
if (GetProfile() < 0) return;
|
||||
|
||||
unsigned char usb_buf[ZET_FURY_PRO_STATE_BUFFER_LENGTH];
|
||||
memcpy(usb_buf, device_configuration, sizeof(usb_buf));
|
||||
memcpy(usb_buf + 23, device_colors, sizeof(device_colors)); // colors are bytes 23-43 in RGB format counting from 0
|
||||
|
||||
usb_buf[21] = current_mode;
|
||||
usb_buf[22] = current_direction;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
|
||||
int SinowealthController1007::GetProfile()
|
||||
{
|
||||
int bytesReceived;
|
||||
|
||||
memset(device_configuration, 0x00, ZET_FURY_PRO_STATE_BUFFER_LENGTH);
|
||||
device_configuration[0] = 0x04;
|
||||
|
||||
bytesReceived = hid_get_feature_report(dev, device_configuration, ZET_FURY_PRO_STATE_BUFFER_LENGTH);
|
||||
if (bytesReceived < 0)
|
||||
{
|
||||
LOG_ERROR("[ZET Fury Pro] Error reading device configuration!");
|
||||
}
|
||||
|
||||
return bytesReceived;
|
||||
}
|
||||
81
Controllers/SinowealthController/SinowealthController1007.h
Normal file
81
Controllers/SinowealthController/SinowealthController1007.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*-----------------------------------------*\
|
||||
| SinowealthController1007.h |
|
||||
| |
|
||||
| Definitions and types for Sinowealth |
|
||||
| mice with PID 1007 and ones with similar |
|
||||
| protocol |
|
||||
| |
|
||||
| Moon_darker (Vaker) 25.01.2022 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
#include <vector>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
#define ZET_FURY_PRO_STATE_BUFFER_LENGTH 59
|
||||
#define ZET_FURY_PRO_COLOR_BUFFER_LENGTH 21
|
||||
|
||||
#define ZET_FURY_PRO_BRIGHTNESS_MIN 1
|
||||
#define ZET_FURY_PRO_BRIGHTNESS_MAX 9
|
||||
#define ZET_FURY_PRO_BRIGHTNESS_DEF 9
|
||||
|
||||
#define ZET_FURY_PRO_SPEED_MIN 1
|
||||
#define ZET_FURY_PRO_SPEED_MAX 3
|
||||
#define ZET_FURY_PRO_SPEED_DEF 2
|
||||
|
||||
enum
|
||||
{
|
||||
ZET_FURY_PRO_MODE_OFF = 0x00,
|
||||
ZET_FURY_PRO_MODE_RAINBOW = 0x10,
|
||||
ZET_FURY_PRO_MODE_STATIC = 0x20,
|
||||
ZET_FURY_PRO_MODE_BREATHING = 0x30,
|
||||
ZET_FURY_PRO_MODE_PENDULUM = 0x40,
|
||||
ZET_FURY_PRO_MODE_SPECTRUM = 0x50,
|
||||
ZET_FURY_PRO_MODE_CUSTOM = 0x60,
|
||||
ZET_FURY_PRO_MODE_TWO_COLORS = 0x70,
|
||||
ZET_FURY_PRO_MODE_REACTIVE = 0x80,
|
||||
ZET_FURY_PRO_MODE_FLICKER = 0x90,
|
||||
ZET_FURY_PRO_MODE_RAIN = 0xA0,
|
||||
ZET_FURY_PRO_MODE_SNAKE = 0xB0,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ZET_FURY_PRO_SUBMODE_SET_COLOR = 0x07,
|
||||
ZET_FURY_PRO_SUBMODE_RANDOM = 0x80,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ZET_FURY_PRO_DIR_LEFT = 0x80,
|
||||
ZET_FURY_PRO_DIR_RIGHT = 0x00,
|
||||
};
|
||||
|
||||
class SinowealthController1007
|
||||
{
|
||||
public:
|
||||
SinowealthController1007(hid_device* dev, char *_path);
|
||||
~SinowealthController1007();
|
||||
|
||||
unsigned int GetLEDCount();
|
||||
std::string GetLocation();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SetLEDColors(const std::vector<RGBColor>& colors);
|
||||
void SetMode(unsigned char mode, unsigned char spd_or_lum, unsigned char direction, const std::vector<RGBColor>& colors, unsigned char random, bool has_per_led_colors);
|
||||
int GetProfile();
|
||||
void SendPacket();
|
||||
private:
|
||||
hid_device* dev;
|
||||
|
||||
unsigned int led_count;
|
||||
|
||||
unsigned char current_mode;
|
||||
unsigned char current_direction;
|
||||
unsigned char device_configuration[ZET_FURY_PRO_STATE_BUFFER_LENGTH];
|
||||
unsigned char device_colors[ZET_FURY_PRO_COLOR_BUFFER_LENGTH];
|
||||
|
||||
std::string location;
|
||||
};
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
#include "Detector.h"
|
||||
#include "SinowealthController.h"
|
||||
#include "SinowealthController1007.h"
|
||||
#include "SinowealthKeyboardController.h"
|
||||
#include "SinowealthKeyboard16Controller.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_Sinowealth.h"
|
||||
#include "RGBController_Sinowealth1007.h"
|
||||
#include "RGBController_SinowealthKeyboard.h"
|
||||
#include "RGBController_SinowealthKeyboard16.h"
|
||||
#include <hidapi/hidapi.h>
|
||||
|
|
@ -14,6 +16,7 @@
|
|||
#define Glorious_Model_O_PID 0x0036
|
||||
#define Glorious_Model_D_PID 0x0033
|
||||
#define Everest_GT100_PID 0x0029
|
||||
#define ZET_FURY_PRO_PID 0x1007
|
||||
#define Fl_Esports_F11_PID 0x0049
|
||||
#define RGB_KEYBOARD_0016PID 0x0016
|
||||
|
||||
|
|
@ -212,27 +215,52 @@ void DetectSinowealthMouse(hid_device_info* info, const std::string& name)
|
|||
| The 4 on 0xFF00 is for RGB, 7 is Unknown and 5 (or 8, or whatever...) is for Commands. |
|
||||
\*-------------------------------------------------------------------------------------------------*/
|
||||
expected_reports* reports = new expected_reports();
|
||||
RGBController *rgb_controller;
|
||||
|
||||
unsigned char command[6] = {0x05, 0x11, 0x00, 0x00, 0x00, 0x00};
|
||||
reports->emplace_back(new expected_report(0x04, 520, command, sizeof(command)));
|
||||
|
||||
if (DetectUsages(info, name, 3, *reports))
|
||||
if (pid == ZET_FURY_PRO_PID)
|
||||
{
|
||||
SinowealthController* controller = new SinowealthController(reports->at(0)->device, reports->at(0)->cmd_device, info->path);
|
||||
RGBController_Sinowealth* rgb_controller = new RGBController_Sinowealth(controller);
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
reports->emplace_back(new expected_report(0x04, 59));
|
||||
|
||||
if (!DetectUsages(info, name, 5, *reports)) return;
|
||||
|
||||
SinowealthController1007* controller = new SinowealthController1007(reports->at(0)->device, info->path);
|
||||
rgb_controller = new RGBController_Sinowealth1007(controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char command[6] = {0x05, 0x11, 0x00, 0x00, 0x00, 0x00};
|
||||
reports->emplace_back(new expected_report(0x04, 520, command, sizeof(command)));
|
||||
|
||||
if (!DetectUsages(info, name, 3, *reports)) return;
|
||||
|
||||
SinowealthController* controller = new SinowealthController(reports->at(0)->device, reports->at(0)->cmd_device, info->path);
|
||||
rgb_controller = new RGBController_Sinowealth(controller);
|
||||
}
|
||||
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
|
||||
reports->clear();
|
||||
#else
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
if(dev)
|
||||
{
|
||||
SinowealthController* controller = new SinowealthController(dev, dev, info->path);
|
||||
RGBController_Sinowealth* rgb_controller = new RGBController_Sinowealth(controller);
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
RGBController *rgb_controller;
|
||||
|
||||
if (pid == ZET_FURY_PRO_PID)
|
||||
{
|
||||
SinowealthController1007* controller = new SinowealthController1007(dev, info->path);
|
||||
rgb_controller = new RGBController_Sinowealth1007(controller);
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
SinowealthController* controller = new SinowealthController(dev, dev, info->path);
|
||||
rgb_controller = new RGBController_Sinowealth(controller);
|
||||
rgb_controller->name = name;
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -294,12 +322,14 @@ void DetectSinowealthKeyboard(hid_device_info* info, const std::string& name)
|
|||
REGISTER_HID_DETECTOR_P("Glorious Model O / O-", DetectSinowealthMouse, SINOWEALTH_VID, Glorious_Model_O_PID, 0xFF00);
|
||||
REGISTER_HID_DETECTOR_P("Glorious Model D / D-", DetectSinowealthMouse, SINOWEALTH_VID, Glorious_Model_D_PID, 0xFF00);
|
||||
REGISTER_HID_DETECTOR_P("Everest GT-100 RGB", DetectSinowealthMouse, SINOWEALTH_VID, Everest_GT100_PID, 0xFF00);
|
||||
REGISTER_HID_DETECTOR_IPU("ZET Fury Pro", DetectSinowealthMouse, SINOWEALTH_VID, ZET_FURY_PRO_PID, 1, 0xFF00, 1);
|
||||
REGISTER_HID_DETECTOR_P("FL ESPORTS F11", DetectSinowealthKeyboard, SINOWEALTH_VID, Fl_Esports_F11_PID, 0xFF00);
|
||||
REGISTER_HID_DETECTOR_P("Sinowealth Keyboard", DetectSinowealthKeyboard, SINOWEALTH_VID, RGB_KEYBOARD_0016PID, 0xFF00);
|
||||
#else
|
||||
REGISTER_HID_DETECTOR_I("Glorious Model O / O-", DetectSinowealthMouse, SINOWEALTH_VID, Glorious_Model_O_PID, 1);
|
||||
REGISTER_HID_DETECTOR_I("Glorious Model D / D-", DetectSinowealthMouse, SINOWEALTH_VID, Glorious_Model_D_PID, 1);
|
||||
REGISTER_HID_DETECTOR_I("Everest GT-100 RGB", DetectSinowealthMouse, SINOWEALTH_VID, Everest_GT100_PID, 1);
|
||||
REGISTER_HID_DETECTOR_I("ZET Fury Pro", DetectSinowealthMouse, SINOWEALTH_VID, ZET_FURY_PRO_PID, 1);
|
||||
REGISTER_HID_DETECTOR_I("FL ESPORTS F11", DetectSinowealthKeyboard, SINOWEALTH_VID, Fl_Esports_F11_PID, 1);
|
||||
REGISTER_HID_DETECTOR_I("Sinowealth Keyboard", DetectSinowealthKeyboard, SINOWEALTH_VID, RGB_KEYBOARD_0016PID, 1);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -455,9 +455,11 @@ HEADERS +=
|
|||
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV1.h \
|
||||
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV3.h \
|
||||
Controllers/SinowealthController/SinowealthController.h \
|
||||
Controllers/SinowealthController/SinowealthController1007.h \
|
||||
Controllers/SinowealthController/SinowealthKeyboardController.h \
|
||||
Controllers/SinowealthController/SinowealthKeyboard16Controller.h \
|
||||
Controllers/SinowealthController/RGBController_Sinowealth.h \
|
||||
Controllers/SinowealthController/RGBController_Sinowealth1007.h \
|
||||
Controllers/SinowealthController/RGBController_SinowealthKeyboard.h \
|
||||
Controllers/SinowealthController/RGBController_SinowealthKeyboard16.h \
|
||||
Controllers/SonyDS4Controller/SonyDS4Controller.h \
|
||||
|
|
@ -903,10 +905,12 @@ SOURCES +=
|
|||
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV1.cpp \
|
||||
Controllers/SapphireGPUController/RGBController_SapphireNitroGlowV3.cpp \
|
||||
Controllers/SinowealthController/SinowealthController.cpp \
|
||||
Controllers/SinowealthController/SinowealthController1007.cpp \
|
||||
Controllers/SinowealthController/SinowealthKeyboardController.cpp \
|
||||
Controllers/SinowealthController/SinowealthKeyboard16Controller.cpp \
|
||||
Controllers/SinowealthController/SinowealthControllerDetect.cpp \
|
||||
Controllers/SinowealthController/RGBController_Sinowealth.cpp \
|
||||
Controllers/SinowealthController/RGBController_Sinowealth1007.cpp \
|
||||
Controllers/SinowealthController/RGBController_SinowealthKeyboard.cpp \
|
||||
Controllers/SinowealthController/RGBController_SinowealthKeyboard16.cpp \
|
||||
Controllers/SonyDS4Controller/SonyDS4Controller.cpp \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue