ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dpi.h
Go to the documentation of this file.
1 #ifndef DPI_H
2 #define DPI_H
3 
4 #include "includes.h"
5 #include "device.h"
6 
7 // DPI functions are mouse-only; do not use them with keyboards.
8 // Lock dmutex before using commands (see device.h)
9 
10 // Sends the current DPI values to a device. force = 0 to update only if changed, force = 1 to update no matter what. Returns 0 on success.
11 int updatedpi(usbdevice* kb, int force);
12 // Saves DPI states to device memory. Return 0 on success.
13 int savedpi(usbdevice* kb, dpiset* dpi, lighting* light);
14 // Loads DPI states from device memory. Returns 0 on success.
15 int loaddpi(usbdevice* kb, dpiset* dpi, lighting* light);
16 
17 // Generates data for a DPI command to match the current state (analagous to printrgb).
18 // The result must be freed later.
19 char* printdpi(const dpiset* dpi, const usbdevice* kb);
20 
21 // Command: Set DPI levels
22 void cmd_dpi(usbdevice* kb, usbmode* mode, int dummy, const char* stages, const char* values);
23 // Command: Select current DPI
24 void cmd_dpisel(usbdevice* kb, usbmode* mode, int dummy1, int dummy2, const char* stage);
25 // Command: Set lift height
26 void cmd_lift(usbdevice* kb, usbmode* mode, int dummy1, int dummy2, const char* height);
27 // Command: Enable/disable angle snap
28 void cmd_snap(usbdevice* kb, usbmode* mode, int dummy1, int dummy2, const char* enable);
29 
30 #endif // DPI_H
31 
void cmd_dpisel(usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *stage)
Definition: dpi.c:47
char * printdpi(const dpiset *dpi, const usbdevice *kb)
Definition: dpi.c:84
int loaddpi(usbdevice *kb, dpiset *dpi, lighting *light)
Definition: dpi.c:222
void cmd_snap(usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *enable)
Definition: dpi.c:73
void cmd_lift(usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *height)
Definition: dpi.c:60
int updatedpi(usbdevice *kb, int force)
Definition: dpi.c:106
void cmd_dpi(usbdevice *kb, usbmode *mode, int dummy, const char *stages, const char *values)
Definition: dpi.c:4
int savedpi(usbdevice *kb, dpiset *dpi, lighting *light)
Definition: dpi.c:194