27 #ifndef MCR_STANDARD_LINUX_P_DEVICE_H_ 28 #define MCR_STANDARD_LINUX_P_DEVICE_H_ 31 #include "mcr/util/linux/p_util.h" 47 struct uinput_user_dev device;
49 const int *set_events;
50 size_t set_event_count;
55 size_t event_bit_count;
66 extern MCR_API
const struct input_event
mcr_syncer;
108 MCR_API
void mcr_Device_set_uibit(
struct mcr_Device *devPt,
int *uiEvents,
size_t count);
134 static MCR_INLINE
int mcr_Device_send(
struct mcr_Device *devPt,
const struct input_event *eventObjects,
size_t bytes)
137 if (devPt->
fd == -1) {
141 if (write(devPt->
fd, eventObjects, bytes) != bytes) {
154 static MCR_INLINE
int mcr_Device_single(
struct mcr_Device *devPt,
const struct input_event *eventObjects)
156 return mcr_Device_send(devPt, eventObjects,
sizeof(
struct input_event));
160 static MCR_INLINE
int mcr_Device_sync(
struct mcr_Device *devPt)
162 return mcr_Device_send(devPt, &
mcr_syncer,
sizeof(
struct input_event));
MCR_API int mcr_Device_deinitialize(struct mcr_context *context)
MCR_API int mcr_Device_set_uinput_path(struct mcr_context *ctx, const char *path)
MCR_API mcr_EvbitRange_t * mcr_Device_bits(struct mcr_Device *devPt, int setUiBit)
MCR_API void mcr_Device_deinit(struct mcr_Device *devPt)
MCR_API int mcr_Device_set_event_path(struct mcr_context *ctx, const char *directoryPath)
MCR_API int mcr_Device_enable(struct mcr_Device *devPt, bool enable)
MCR_API const struct input_event mcr_syncer
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)
Base module implements mcr_base - Libmacro first module.
MCR_API bool mcr_Device_has_evbit(struct mcr_Device *devPt)
MCR_API void mcr_Device_set_evbits(struct mcr_Device *devPt, mcr_EvbitRange_t *evBits, size_t count)
MCR_API int mcr_Device_enable_all(struct mcr_context *ctx, bool enable)
MCR_API int mcr_Device_set_absolute_resolution(struct mcr_context *ctx, __s32 resolution)
MCR_API int mcr_Device_initialize(struct mcr_context *context)