#include "command.h"
#include "led.h"
#include "profile.h"
#include "usb.h"
Go to the source code of this file.
|
void | cmd_rgb (usbdevice *kb, usbmode *mode, int dummy, int keyindex, const char *code) |
|
static uchar | iselect (const char *led) |
|
void | cmd_ioff (usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *led) |
|
void | cmd_ion (usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *led) |
|
void | cmd_iauto (usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *led) |
|
void | cmd_inotify (usbdevice *kb, usbmode *mode, int nnumber, int dummy, const char *led) |
|
static int | has_key (const char *name, const usbdevice *kb) |
|
char * | printrgb (const lighting *light, const usbdevice *kb) |
|
void cmd_iauto |
( |
usbdevice * |
kb, |
|
|
usbmode * |
mode, |
|
|
int |
dummy1, |
|
|
int |
dummy2, |
|
|
const char * |
led |
|
) |
| |
void cmd_inotify |
( |
usbdevice * |
kb, |
|
|
usbmode * |
mode, |
|
|
int |
nnumber, |
|
|
int |
dummy, |
|
|
const char * |
led |
|
) |
| |
void cmd_ioff |
( |
usbdevice * |
kb, |
|
|
usbmode * |
mode, |
|
|
int |
dummy1, |
|
|
int |
dummy2, |
|
|
const char * |
led |
|
) |
| |
void cmd_ion |
( |
usbdevice * |
kb, |
|
|
usbmode * |
mode, |
|
|
int |
dummy1, |
|
|
int |
dummy2, |
|
|
const char * |
led |
|
) |
| |
void cmd_rgb |
( |
usbdevice * |
kb, |
|
|
usbmode * |
mode, |
|
|
int |
dummy, |
|
|
int |
keyindex, |
|
|
const char * |
code |
|
) |
| |
Definition at line 6 of file led.c.
References lighting::b, lighting::g, keymap, key::led, usbmode::light, lighting::r, and lighting::sidelight.
14 if (sscanf(code,
"%2hhx",&sideshine))
20 if(sscanf(code,
"%2hhx%2hhx%2hhx", &r, &g, &b) == 3){
const key keymap[(((152+22+12)+25)+12)]
static int has_key |
( |
const char * |
name, |
|
|
const usbdevice * |
kb |
|
) |
| |
|
static |
Definition at line 88 of file led.c.
References IS_K63, IS_K65, IS_K95, IS_MOUSE, IS_SABRE, IS_SCIMITAR, usbdevice::product, and usbdevice::vendor.
Referenced by printrgb().
97 if(strstr(name,
"dpi") == name || !strcmp(name,
"front") || !strcmp(name,
"back"))
102 if(strstr(name,
"dpi") == name || !strcmp(name,
"front") || !strcmp(name,
"back") || !strcmp(name,
"wheel") || !strcmp(name,
"thumb"))
105 if(!
IS_K95(kb) && ((name[0] ==
'g' && name[1] >=
'1' && name[1] <=
'9') || (name[0] ==
'm' && (name[1] ==
'r' || name[1] ==
'1' || name[1] ==
'2' || name[1] ==
'3'))))
108 if((!
IS_K65(kb) && !
IS_K63(kb)) && (!strcmp(name,
"volup") || !strcmp(name,
"voldn")))
111 if(
IS_K65(kb) && (strstr(name,
"num") == name || !strcmp(name,
"stop") || !strcmp(name,
"prev") || !strcmp(name,
"play") || !strcmp(name,
"next")))
114 if(
IS_K63(kb) && strstr(name,
"num") == name)
#define IS_MOUSE(vendor, product)
Mouse vs keyboard test.
static uchar iselect |
( |
const char * |
led | ) |
|
|
static |
Definition at line 28 of file led.c.
References I_CAPS, I_NUM, and I_SCROLL.
Referenced by cmd_iauto(), cmd_inotify(), cmd_ioff(), and cmd_ion().
30 if(!strncmp(led,
"num", 3) || strstr(led,
",num"))
32 if(!strncmp(led,
"caps", 4) || strstr(led,
",caps"))
34 if(!strncmp(led,
"scroll", 6) || strstr(led,
",scroll"))
36 if(!strncmp(led,
"all", 3) || strstr(led,
",all"))
Definition at line 120 of file led.c.
References lighting::b, lighting::g, has_key(), keymap, key::led, N_KEYS_EXTENDED, key::name, and lighting::r.
Referenced by _cmd_get().
122 const uchar* mr = light->
r;
123 const uchar* mg = light->
g;
124 const uchar* mb = light->
b;
141 strncpy(names[i], name, 11);
148 if(r[i] != r[0] || g[i] != g[0] || b[i] != b[0]){
155 char* buffer = malloc(7);
156 snprintf(buffer, 7,
"%02x%02x%02x", r[0], g[0], b[0]);
159 const int BUFFER_LEN = 4096;
160 char* buffer = malloc(BUFFER_LEN);
167 snprintf(buffer + length, BUFFER_LEN - length, length == 0 ?
"%s%n" :
" %s%n", names[i], &newlen);
170 uchar kr = r[i], kg = g[i], kb = b[i];
174 if(r[j] != kr || g[j] != kg || b[j] != kb)
176 snprintf(buffer + length, BUFFER_LEN - length,
",%s%n", names[j], &newlen);
182 snprintf(buffer + length, BUFFER_LEN - length,
":%02x%02x%02x%n", kr, kg, kb, &newlen);
static int has_key(const char *name, const usbdevice *kb)
const key keymap[(((152+22+12)+25)+12)]