ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
Go to the source code of this file.
Macros | |
#define | IS_WHEEL(scan, kb) (((scan) == KEY_VOLUMEUP || (scan) == KEY_VOLUMEDOWN || (scan) == BTN_WHEELUP || (scan) == BTN_WHEELDOWN) && (!IS_K65(kb) && !IS_K63(kb))) |
Functions | |
int | macromask (const uchar *key1, const uchar *key2) |
static void | macro_pt_enqueue () |
macro_pt_enqueue Save the new thread in the single linked list (FIFO). More... | |
static pthread_t | macro_pt_dequeue () |
macro_pt_dequeue gets the first thread id of the list and returns the thread_id stored in it. More... | |
static pthread_t | macro_pt_first () |
macro_pt_first returns the first pthread_id but does not remove the first entry. More... | |
static void * | play_macro (void *param) |
play_macro is the code for all threads started to play a macro. More... | |
static void | inputupdate_keys (usbdevice *kb) |
inputupdate_keys Handle input from Keyboard or mouse; start Macrof if detected. More... | |
void | inputupdate (usbdevice *kb) |
void | updateindicators_kb (usbdevice *kb, int force) |
void | initbind (binding *bind) |
void | freebind (binding *bind) |
void | cmd_bind (usbdevice *kb, usbmode *mode, int dummy, int keyindex, const char *to) |
void | cmd_unbind (usbdevice *kb, usbmode *mode, int dummy, int keyindex, const char *to) |
void | cmd_rebind (usbdevice *kb, usbmode *mode, int dummy, int keyindex, const char *to) |
static void | _cmd_macro (usbmode *mode, const char *keys, const char *assignment) |
void | cmd_macro (usbdevice *kb, usbmode *mode, const int notifynumber, const char *keys, const char *assignment) |
Variables | |
static ptlist_t * | pt_head = 0 |
pt_head is the head pointer for the single linked thread list managed by macro_pt_en/dequeue(). More... | |
static ptlist_t * | pt_tail = 0 |
pt_tail is the tail pointer for the single linked thread list managed by macro_pt_en/dequeue(). More... | |
#define IS_WHEEL | ( | scan, | |
kb | |||
) | (((scan) == KEY_VOLUMEUP || (scan) == KEY_VOLUMEDOWN || (scan) == BTN_WHEELUP || (scan) == BTN_WHEELDOWN) && (!IS_K65(kb) && !IS_K63(kb))) |
Referenced by inputupdate_keys().
|
static |
Definition at line 353 of file input.c.
References keymacro::actioncount, keymacro::actions, usbmode::bind, keymacro::combo, macroaction::delay, macroaction::down, keymap, left, MACRO_MAX, binding::macrocap, binding::macrocount, binding::macros, N_KEYBYTES_INPUT, N_KEYS_INPUT, right(), macroaction::scan, key::scan, and SET_KEYBIT.
Referenced by cmd_macro().
Definition at line 307 of file input.c.
References binding::base, usbmode::bind, imutex, keymap, N_KEYS_INPUT, and key::scan.
void cmd_macro | ( | usbdevice * | kb, |
usbmode * | mode, | ||
const int | notifynumber, | ||
const char * | keys, | ||
const char * | assignment | ||
) |
Definition at line 475 of file input.c.
References _cmd_macro(), and imutex.
Definition at line 342 of file input.c.
References binding::base, usbmode::bind, imutex, keymap, N_KEYS_INPUT, and key::scan.
Definition at line 331 of file input.c.
References binding::base, usbmode::bind, imutex, KEY_UNBOUND, and N_KEYS_INPUT.
void freebind | ( | binding * | bind | ) |
Definition at line 300 of file input.c.
References keymacro::actions, binding::macrocount, and binding::macros.
Referenced by freemode().
void initbind | ( | binding * | bind | ) |
Definition at line 292 of file input.c.
References binding::base, keymap, binding::macrocap, binding::macrocount, binding::macros, N_KEYS_INPUT, and key::scan.
Referenced by initmode().
void inputupdate | ( | usbdevice * | kb | ) |
Definition at line 241 of file input.c.
References usbdevice::input, inputupdate_keys(), os_mousemove(), usbdevice::profile, usbinput::rel_x, usbinput::rel_y, usbdevice::uinput_kb, and usbdevice::uinput_mouse.
Referenced by os_inputmain(), setactive_kb(), and setactive_mouse().
|
static |
kb |
Process all queued keypresses if no macro is running yet.
Definition at line 134 of file input.c.
References usbdevice::active, binding::base, usbmode::bind, keymacro::combo, usbprofile::currentmode, usbdevice::input, IS_MOD, IS_WHEEL, parameter::kb, keymap, usbinput::keys, parameter::macro, macro_pt_first(), binding::macrocount, macromask(), binding::macros, N_KEYBYTES_INPUT, N_KEYS_INPUT, usbmode::notify, nprintkey(), os_keypress(), OUTFIFO_MAX, play_macro(), usbinput::prevkeys, usbdevice::profile, key::scan, SCAN_SILENT, and keymacro::triggered.
Referenced by inputupdate().
|
static |
< why are we called?
< Was last element in the list, so clear tail.
< save the return value before deleting element
Definition at line 49 of file input.c.
References ckb_err, ptlist::next, pt_head, and ptlist::thread_id.
Referenced by play_macro().
|
static |
< exit on critical situation;
< The element knows its ID byself
< new list, first element
< existing list, append on last element (FIFO)
Definition at line 27 of file input.c.
References ptlist::next, and ptlist::thread_id.
Referenced by play_macro().
|
static |
Definition at line 70 of file input.c.
References ptlist::thread_id.
Referenced by inputupdate_keys(), and play_macro().
Definition at line 6 of file input.c.
References N_KEYBYTES_INPUT.
Referenced by inputupdate_keys().
|
static |
param | parameter_t to store Kb-ptr and macro-ptr (thread may get only one user-parameter) |
First have a look if we are the first and only macro-thread to run. If not, wait. So enqueue our thread first, so it is remembered for us and can be seen by all others.
< If the first thread in the list is not our, another one is running
< Give all new threads the chance to enter the block.
Send events for each keypress in the macro
< Synchonization between macro output and color information
< use this unlock / relock for enablling the parallel running colorization
< local delay set
< use default global delay
< use delays depending on macro length
< protect the linked list and the mvar
< Wake up all waiting threads
< for the linked list and the mvar
< Sync keyboard input/output and colorization
Definition at line 79 of file input.c.
References keymacro::actioncount, keymacro::actions, macroaction::delay, usbdevice::delay, macroaction::down, parameter::kb, parameter::macro, macro_pt_dequeue(), macro_pt_enqueue(), macro_pt_first(), mmutex, mmutex2, mvar, os_keypress(), os_mousemove(), macroaction::rel_x, macroaction::rel_y, and macroaction::scan.
Referenced by inputupdate_keys().
void updateindicators_kb | ( | usbdevice * | kb, |
int | force | ||
) |
Definition at line 261 of file input.c.
References usbdevice::active, usbprofile::currentmode, DELAY_SHORT, usbdevice::hw_ileds, usbdevice::hw_ileds_old, I_CAPS, I_NUM, I_SCROLL, usbdevice::ileds, usbmode::inotify, usbmode::ioff, usbmode::ion, nprintind(), os_sendindicators(), OUTFIFO_MAX, and usbdevice::profile.
|
static |
Definition at line 18 of file input.c.
Referenced by macro_pt_dequeue().