![]() |
Libmacro
0.2
Libmacro is an extensible macro and hotkey library.
|
Currently Linux-specific. mcr_Device is a wrapper for creating uinput devices. More...
Go to the source code of this file.
Classes | |
| struct | mcr_EvbitRange_t |
| struct | mcr_Device |
Functions | |
| MCR_API int | mcr_Device_set_uinput_path (struct mcr_context *ctx, const char *path) |
| MCR_API int | mcr_Device_set_event_path (struct mcr_context *ctx, const char *directoryPath) |
| MCR_API int | mcr_Device_set_absolute_resolution (struct mcr_context *ctx, __s32 resolution) |
| MCR_API void | mcr_Device_ctor (struct mcr_Device *devPt, struct mcr_context *ctx, const char *name, const int *setEvents, size_t setEventCount, const mcr_EvbitRange_t *eventBits, size_t eventBitCount) |
| MCR_API void | mcr_Device_deinit (struct mcr_Device *devPt) |
| MCR_API int | mcr_Device_enable (struct mcr_Device *devPt, bool enable) |
| MCR_API int | mcr_Device_enable_all (struct mcr_context *ctx, bool enable) |
| MCR_API void | mcr_Device_set_uibit (struct mcr_Device *devPt, int *uiEvents, size_t count) |
| MCR_API void | mcr_Device_set_evbits (struct mcr_Device *devPt, mcr_EvbitRange_t *evBits, size_t count) |
| MCR_API mcr_EvbitRange_t * | mcr_Device_bits (struct mcr_Device *devPt, int setUiBit) |
| MCR_API bool | mcr_Device_has_evbit (struct mcr_Device *devPt) |
| MCR_API int | mcr_Device_initialize (struct mcr_context *context) |
| MCR_API int | mcr_Device_deinitialize (struct mcr_context *context) |
Variables | |
| MCR_API const struct input_event | mcr_syncer |
Currently Linux-specific. mcr_Device is a wrapper for creating uinput devices.
The source file contains predefined devices for keyboard, absolute, and relative.
Definition in file p_device.h.
| MCR_API mcr_EvbitRange_t* mcr_Device_bits | ( | struct mcr_Device * | devPt, |
| int | setUiBit | ||
| ) |
Get all input bits to be set.
| bitType | Type of event to find values for |
| MCR_API void mcr_Device_ctor | ( | struct mcr_Device * | devPt, |
| struct mcr_context * | ctx, | ||
| const char * | name, | ||
| const int * | setEvents, | ||
| size_t | setEventCount, | ||
| const mcr_EvbitRange_t * | eventBits, | ||
| size_t | eventBitCount | ||
| ) |
| MCR_API void mcr_Device_deinit | ( | struct mcr_Device * | devPt | ) |
| MCR_API int mcr_Device_deinitialize | ( | struct mcr_context * | context | ) |
Dealocate resources for linux devices.
| MCR_API int mcr_Device_enable | ( | struct mcr_Device * | devPt, |
| bool | enable | ||
| ) |
Start or end user device. This will modify fd, event_fd, and enabled state.
| MCR_API int mcr_Device_enable_all | ( | struct mcr_context * | ctx, |
| bool | enable | ||
| ) |
mcr_Device_enable for all devices
| MCR_API bool mcr_Device_has_evbit | ( | struct mcr_Device * | devPt | ) |
Does the device have UI_SET_EVBIT?
| MCR_API int mcr_Device_initialize | ( | struct mcr_context * | context | ) |
Initialize values for known mcr_Device objects, and allocate resources.
| MCR_API int mcr_Device_set_absolute_resolution | ( | struct mcr_context * | ctx, |
| __s32 | resolution | ||
| ) |
Linux - Set absolute device resolution
| MCR_API void mcr_Device_set_evbits | ( | struct mcr_Device * | devPt, |
| mcr_EvbitRange_t * | evBits, | ||
| size_t | count | ||
| ) |
Set input bit values for a single bit type.
| bitType | Type of event to set values for |
| bits | Set of all values to set for bitType |
| bitLen | Length of bits |
| MCR_API int mcr_Device_set_event_path | ( | struct mcr_context * | ctx, |
| const char * | directoryPath | ||
| ) |
Linux - Set the directory event files are located in
Event files are used to read device state
| MCR_API int mcr_Device_set_uinput_path | ( | struct mcr_context * | ctx, |
| const char * | path | ||
| ) |
Linux - Set the uinput file to read and write uinput devices
| MCR_API const struct input_event mcr_syncer |
Linux - Append similar input_event to the end of all sending of events.