mirror of
https://github.com/moparisthebest/uinput-mapper
synced 2024-11-16 13:45:00 -05:00
Forgot config_functions.h
This commit is contained in:
parent
ee47d5a6ac
commit
555df71402
38
config_functions.h
Normal file
38
config_functions.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#ifndef H_CONFIG_FUNCTIONS
|
||||||
|
#define H_CONFIG_FUNCTIONS
|
||||||
|
|
||||||
|
#define JOYSTICK_SET_OPT(opt, bit, device) \
|
||||||
|
if (device == j) { \
|
||||||
|
if (ioctl(js[device], bit, opt) < 0) { \
|
||||||
|
perror("Error in JOYSTICK_SET_OPT"); \
|
||||||
|
fprintf(stderr, "ERROR: JOYSTICK_SET_OPT for device %d, opt %s, bit: %s\n", device, #opt, #bit); \
|
||||||
|
} else { \
|
||||||
|
printf("JOYSTICK_SET_OPT for device %d, opt %s, bit: %s\n", device, #opt, #bit); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define JOYSTICK_ADD_KEY(key, bit, device) \
|
||||||
|
if (device == j) { \
|
||||||
|
if (ioctl(js[device], bit, key) < 0) { \
|
||||||
|
perror("Error in JOYSTICK_ADD_KEY"); \
|
||||||
|
fprintf(stderr, "ERROR: JOYSTICK_ADD_KEY for device %d, key %s, bit: %s\n", device, #key, #bit); \
|
||||||
|
return 1; \
|
||||||
|
} else { \
|
||||||
|
printf("JOYSTICK_ADD_KEY for device %d, key %s, bit: %s\n", device, #key, #bit); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define JOYSTICK_SET_LIM(lim, val, key) \
|
||||||
|
uidev.lim[key] = val;
|
||||||
|
|
||||||
|
|
||||||
|
#define KEYMAP(in_key, out_key, out_type, device, val) \
|
||||||
|
case in_key: \
|
||||||
|
je.type = out_type; \
|
||||||
|
je.code = out_key; \
|
||||||
|
je.value = val(e.value); \
|
||||||
|
j = device; \
|
||||||
|
break;
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user