Add RGBController for Redragon K556 keyboard, only supports custom mode for now
This commit is contained in:
parent
ad85efcb14
commit
68960b7b14
7 changed files with 142 additions and 38 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#include "RedragonK556Controller.h"
|
||||
#include "RedragonM711Controller.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_RedragonK556.h"
|
||||
#include "RGBController_RedragonM711.h"
|
||||
#include "RGBController_Dummy.h"
|
||||
#include <vector>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
|
|
@ -88,10 +88,8 @@ void DetectRedragonControllers(std::vector<RGBController*>& rgb_controllers)
|
|||
case DEVICE_TYPE_KEYBOARD:
|
||||
{
|
||||
RedragonK556Controller* controller = new RedragonK556Controller(dev);
|
||||
RGBController_Dummy* rgb_controller = new RGBController_Dummy();
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
|
||||
RGBController_RedragonK556* rgb_controller = new RGBController_RedragonK556(controller);
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -5,26 +5,6 @@
|
|||
RedragonK556Controller::RedragonK556Controller(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
|
||||
unsigned char color_data[0x36 * 7];
|
||||
|
||||
SendKeyboardBegin();
|
||||
SendKeyboardMode(20);
|
||||
|
||||
for(int i = 0; i < 0x36 * 7; i += 3)
|
||||
{
|
||||
color_data[i] = 0x00;
|
||||
color_data[i+1] = 0xff;
|
||||
color_data[i+2] = 0x00;
|
||||
}
|
||||
|
||||
SetKeyboardColors
|
||||
(
|
||||
color_data,
|
||||
0x36 * 6
|
||||
);
|
||||
|
||||
SendKeyboardEnd();
|
||||
}
|
||||
|
||||
void RedragonK556Controller::SetKeyboardColors
|
||||
|
|
|
|||
|
|
@ -50,9 +50,6 @@ public:
|
|||
unsigned char * color_data,
|
||||
unsigned int size
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
|
||||
void SendKeyboardBegin();
|
||||
|
||||
|
|
@ -70,14 +67,6 @@ private:
|
|||
|
||||
void SendKeyboardEnd();
|
||||
|
||||
void SendMouseApply();
|
||||
|
||||
void SendMouseMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char speed,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
);
|
||||
private:
|
||||
hid_device* dev;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue