-
-
Notifications
You must be signed in to change notification settings - Fork 409
Expand file tree
/
Copy pathAsusAuraTUFKeyboardController.h
More file actions
151 lines (133 loc) · 5.59 KB
/
Copy pathAsusAuraTUFKeyboardController.h
File metadata and controls
151 lines (133 loc) · 5.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*---------------------------------------------------------*\
| AsusAuraTUFKeyboardController.h |
| |
| Driver for ASUS Aura TUF keyboard |
| |
| Mola19 03 Mar 2021 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include <vector>
#include <hidapi.h>
#include "RGBController.h"
#include "AsusAuraTUFKeyboardLayouts.h"
enum
{
AURA_KEYBOARD_MODE_STATIC = 0,
AURA_KEYBOARD_MODE_BREATHING = 1,
AURA_KEYBOARD_MODE_COLOR_CYCLE = 2,
AURA_KEYBOARD_MODE_REACTIVE = 3,
AURA_KEYBOARD_MODE_WAVE = 4,
AURA_KEYBOARD_MODE_RIPPLE = 5,
AURA_KEYBOARD_MODE_STARRY_NIGHT = 6,
AURA_KEYBOARD_MODE_QUICKSAND = 7,
AURA_KEYBOARD_MODE_CURRENT = 8,
AURA_KEYBOARD_MODE_RAIN_DROP = 9,
AURA_KEYBOARD_MODE_DIRECT = 15,
};
enum
{
AURA_ROG_AZOTH_USB_PID = 0x1A83,
AURA_ROG_AZOTH_2_4_PID = 0x1A85,
AURA_ROG_CLAYMORE_PID = 0x184D,
AURA_ROG_FALCHION_WIRED_PID = 0x193C,
AURA_ROG_FALCHION_WIRELESS_PID = 0x193E,
AURA_ROG_FALCHION_RX_LP_WIRED_PID = 0x1B04,
AURA_ROG_STRIX_FLARE_PID = 0x1875,
AURA_ROG_STRIX_FLARE_PNK_LTD_PID = 0x18CF,
AURA_ROG_STRIX_FLARE_COD_BO4_PID = 0x18AF,
AURA_ROG_STRIX_FLARE_II_PID = 0x19FE,
AURA_ROG_STRIX_FLARE_II_ANIMATE_PID = 0x19FC,
AURA_ROG_STRIX_SCOPE_PID = 0x18F8,
AURA_ROG_STRIX_SCOPE_RX_PID = 0x1951,
AURA_ROG_STRIX_SCOPE_RX_EVA_02_PID = 0x1B12,
AURA_ROG_STRIX_SCOPE_NX_WIRELESS_DELUXE_USB_PID = 0x19F6,
AURA_ROG_STRIX_SCOPE_NX_WIRELESS_DELUXE_2_4_PID = 0x19F8,
AURA_ROG_STRIX_SCOPE_II_PID = 0x1AB3,
AURA_ROG_STRIX_SCOPE_II_RX_PID = 0x1AB5,
AURA_ROG_STRIX_SCOPE_II_96_WIRELESS_USB_PID = 0x1AAE,
AURA_ROG_STRIX_SCOPE_II_96_RX_WIRELESS_USB_PID = 0x1B78,
AURA_TUF_K1_GAMING_PID = 0x1945,
AURA_TUF_K3_GAMING_PID = 0x194B,
AURA_TUF_K3_GAMING_GEN_II_PID = 0x1B30,
AURA_TUF_K5_GAMING_PID = 0x1899,
AURA_TUF_K7_GAMING_PID = 0x18AA,
AURA_TUF_K3_GENII_MIKU_EDITION_PID = 0x1C5E,
};
struct led_color
{
unsigned int value;
RGBColor color;
};
class AuraTUFKeyboardController
{
public:
AuraTUFKeyboardController(hid_device* dev_handle, const char* path, uint16_t pid, unsigned short version, std::string dev_name);
~AuraTUFKeyboardController();
std::string GetDeviceLocation();
std::string GetName();
std::string GetSerialString();
std::string GetVersion();
int GetLayout();
int GetNumpadLocation();
void SaveMode();
void AllowRemoteControl(unsigned char type);
void UpdateSingleLed
(
int led,
unsigned char red,
unsigned char green,
unsigned char blue
);
void UpdateLeds
(
std::vector<led_color> colors
);
void UpdateK1Wave
(
std::vector<RGBColor> colors,
unsigned char direction,
unsigned char speed,
unsigned char brightness
);
void UpdateScopeIIRainbowRipple
(
unsigned char mode,
std::vector<RGBColor> colors,
unsigned char direction,
unsigned char color_mode,
unsigned char speed,
unsigned char brightness
);
void UpdateScopeIIQuicksand
(
std::vector<RGBColor> colors,
unsigned char direction,
unsigned char color_mode,
unsigned char speed,
unsigned char brightness
);
void UpdateDevice
(
unsigned char mode,
std::vector<RGBColor> colors,
unsigned char direction,
unsigned char color_mode,
unsigned char speed,
unsigned char brightness
);
void UpdateQuicksandColors(std::vector<RGBColor> colors);
void UpdateMode(unsigned char mode);
void AwaitResponse(int ms);
void ClearResponses();
uint16_t device_pid;
bool is_per_led_keyboard;
private:
hid_device* dev;
std::string location;
std::string name;
unsigned short rev_version;
};