Files
OpenRGB/Controllers/DuckyKeyboardController/DuckyKeyboardController.h
D. Stuart Freeman 5e4bc6651a Add Ducky TKL matrix map, select map based on USB PID
Commit amended for code style by Adam Honse <calcprogrammer1@gmail.com>
2021-10-08 22:20:14 -05:00

59 lines
1.7 KiB
C++

/*-----------------------------------------*\
| DuckyKeyboardController.h |
| |
| Definitions and types for Ducky RGB |
| keyboard lighting controller |
| |
| Adam Honse (CalcProgrammer1) 7/4/2020 |
\*-----------------------------------------*/
#include "RGBController.h"
#include <string>
#include <hidapi/hidapi.h>
#pragma once
/*-----------------------------------------------------*\
| Ducky vendor ID |
\*-----------------------------------------------------*/
#define DUCKY_VID 0x04D9
/*-----------------------------------------------------*\
| Keyboard product IDs |
\*-----------------------------------------------------*/
#define DUCKY_SHINE_7_ONE_2_RGB_PID 0x0348
#define DUCKY_ONE_2_RGB_TKL_PID 0x0356
class DuckyKeyboardController
{
public:
DuckyKeyboardController(hid_device* dev_handle, const char* path, const unsigned short pid);
~DuckyKeyboardController();
std::string GetDeviceLocation();
std::string GetSerialString();
unsigned short GetUSBPID();
void SendColors
(
unsigned char* color_data,
unsigned int color_data_size
);
private:
hid_device* dev;
std::string location;
unsigned short usb_pid;
void SendInitialize();
void SendInitializeColorPacket();
unsigned int SendColorDataPacket
(
unsigned char packet_id,
unsigned char* color_data,
unsigned int color_size
);
void SendTerminateColorPacket();
};