12 #define IS_CONNECTED(kb) ((kb) && (kb)->handle && (kb)->uinput_kb && (kb)->uinput_mouse)
14 #define IS_CONNECTED(kb) ((kb) && (kb)->handle && (kb)->event)
18 #define dmutex(kb) (devmutex + INDEX_OF(kb, keyboard))
22 #define imutex(kb) (inputmutex + INDEX_OF(kb, keyboard))
26 #define mmutex(kb) (macromutex + INDEX_OF(kb, keyboard))
28 #define mmutex2(kb) (macromutex2 + INDEX_OF(kb, keyboard))
30 #define mvar(kb) (macrovar + INDEX_OF(kb, keyboard))
44 #define setactive(kb, makeactive) ((makeactive) ? (kb)->vtable->active((kb), 0, 0, 0, 0) : (kb)->vtable->idle((kb), 0, 0, 0, 0))
65 #define IN_CORSAIR 0x40
70 #define ACT_NEXT_NOWRAP 5
pthread_mutex_t devmutex[9]
Mutex for handling the usbdevice structure.
usbdevice keyboard[9]
remember all usb devices. Needed for closeusb().
int start_dev(usbdevice *kb, int makeactive)
int start_kb_nrgb(usbdevice *kb, int makeactive)
pthread_cond_t macrovar[9]
This variable is used to stop and wakeup all macro threads which have to wait.
int cmd_active_mouse(usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4)
int setactive_mouse(usbdevice *kb, int active)
pthread_mutex_t inputmutex[9]
Mutex for dealing with usb input frames.
int cmd_idle_kb(usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4)
int cmd_idle_mouse(usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4)
pthread_mutex_t macromutex2[9]
Protecting the single link list of threads and the macrovar.
void setmodeindex_nrgb(usbdevice *kb, int index)
pthread_mutex_t macromutex[9]
Protecting macros against lightning: Both use usb_send.
int cmd_active_kb(usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4)
int setactive_kb(usbdevice *kb, int active)
int cmd_pollrate(usbdevice *kb, usbmode *dummy1, int dummy2, int rate, const char *dummy3)