forked from coolstar/crosecservice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcroskbhid.h
133 lines (85 loc) · 2.64 KB
/
croskbhid.h
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
#if !defined(_CROSKBHIDREMAPPER_COMMON_H_)
#define _CROSKBHIDREMAPPER_COMMON_H_
typedef struct _croskbhid_client_t* pcroskbhid_client;
//
//These are the device attributes returned by vmulti in response
// to IOCTL_HID_GET_DEVICE_ATTRIBUTES.
//
#define CROSKBHIDREMAPPER_PID 0x0303
#define CROSKBHIDREMAPPER_VID 0x18D1
#define CROSKBHIDREMAPPER_VERSION 0x0004
#define CROSKBLIGHT_PID 0x0002
#define CROSKBLIGHT_VID 0x18D1
#define CROSKBLIGHT_VERSION 0x0001
//
// These are the report ids
//
#define REPORTID_KBLIGHT 0x01
#define REPORTID_KEYBOARD 0x07
#define REPORTID_MEDIA 0x08
#define REPORTID_SETTINGS 0x09
//
// Keyboard specific report infomation
//
#define CROSKBHID_BRIGHTNESS_UP 0x01
#define CROSKBHID_BRIGHTNESS_DN 0x02
#define CROSKBHID_KBLT_UP 0x04
#define CROSKBHID_KBLT_DN 0x08
#define CROSKBHID_KBLT_TOGGLE 0x10
#pragma pack(1)
typedef struct _CROSKBHIDREMAPPER_MEDIA_REPORT
{
BYTE ReportID;
BYTE ControlCode;
BYTE Reserved;
} CrosKBHIDRemapperMediaReport;
#pragma pack()
#pragma pack()
//
// Feature report infomation
//
#define DEVICE_MODE_MOUSE 0x00
#define DEVICE_MODE_SINGLE_INPUT 0x01
#define DEVICE_MODE_MULTI_INPUT 0x02
#pragma pack(1)
typedef struct _CROSKBHIDREMAPPER_FEATURE_REPORT
{
BYTE ReportID;
BYTE DeviceMode;
BYTE DeviceIdentifier;
} CrosKBHIDRemapperFeatureReport;
#pragma pack(1)
typedef struct _CROSKBHIDREMAPPER_SETTINGS_REPORT
{
BYTE ReportID;
BYTE SettingsRegister;
BYTE SettingsValue;
} CrosKBHIDRemapperSettingsReport;
#pragma pack()
#pragma pack(1)
typedef struct _CROSKBLIGHT_GETLIGHT_REPORT
{
BYTE ReportID;
BYTE Brightness;
} CrosKBLightGetLightReport;
#pragma pack()
#pragma pack(1)
typedef struct _CROSKBLIGHT_SETTINGS_REPORT
{
BYTE ReportID;
BYTE SetBrightness;
BYTE Brightness;
} CrosKBLightSettingsReport;
#pragma pack()
pcroskbhid_client croskbhid_alloc(void);
void croskbhid_free(pcroskbhid_client vmulti);
BOOL croskbhid_connect(pcroskbhid_client vmulti);
void croskbhid_disconnect(pcroskbhid_client vmulti);
BOOL croskblight_connect(pcroskbhid_client croskbhid);
void croskblight_disconnect(pcroskbhid_client croskbhid);
BOOL croskbhid_read_keyboard(pcroskbhid_client vmulti, CrosKBHIDRemapperMediaReport* pReport);
BOOL croskbhid_write_keyboard(pcroskbhid_client vmulti, CrosKBHIDRemapperMediaReport* pReport);
BOOL croskblight_read_message(pcroskbhid_client vmulti, CrosKBLightSettingsReport* pReport);
BOOL croskblight_write_message(pcroskbhid_client vmulti, CrosKBLightSettingsReport* pReport);
#endif
#pragma once