return 0;
}
-
/**
* Shift the first n elements into ev and return the number of elements
* shifted.
max = libevdev_event_type_get_max(type); \
break;
-
static inline int
type_to_mask_const(const struct libevdev *dev, unsigned int type, const unsigned long **mask)
{
#undef max_mask
#endif
-
* OF THIS SOFTWARE.
*/
-
struct libevdev_uinput {
int fd; /**< file descriptor to uinput */
int fd_is_managed; /**< do we need to close it? */
return uinput_dev->devnode ? 0 : -1;
}
-
-
LIBEVDEV_EXPORT int
libevdev_uinput_create_from_device(const struct libevdev *dev, int fd, struct libevdev_uinput** uinput_dev)
{
_a > _b ? _a : _b; \
})
-
static inline bool
startswith(const char *str, size_t len, const char *prefix, size_t plen)
{
else if (unlikely(log_data.device_handler))
abort(); /* Seppuku, see above */
-
va_start(args, format);
if (dev && dev->log.device_handler)
dev->log.device_handler(dev, priority, dev->log.userdata, file, line, func, format, args);
set_bit(slot_update, AXISBIT(slot, ABS_MT_SLOT));
}
-
}
}
goto out;
}
-
if (queue_shift(dev, ev) != 0)
return -EAGAIN;
STRING_SETTER(phys)
STRING_SETTER(uniq)
-
#define PRODUCT_GETTER(name) \
LIBEVDEV_EXPORT int libevdev_get_id_##name(const struct libevdev *dev) \
{ \
*/
int libevdev_get_fd(const struct libevdev* dev);
-
/**
* @ingroup events
*/
*/
LIBEVDEV_READ_STATUS_SYNC = 1
};
+
/**
* @ingroup events
*
* @note This function is signal-safe.
*/
int libevdev_get_abs_minimum(const struct libevdev *dev, unsigned int code);
+
/**
* @ingroup bits
*
* @note This function is signal-safe.
*/
int libevdev_get_abs_maximum(const struct libevdev *dev, unsigned int code);
+
/**
* @ingroup bits
*
* @note This function is signal-safe.
*/
int libevdev_get_abs_fuzz(const struct libevdev *dev, unsigned int code);
+
/**
* @ingroup bits
*
* @note This function is signal-safe.
*/
int libevdev_get_abs_flat(const struct libevdev *dev, unsigned int code);
+
/**
* @ingroup bits
*
*/
int libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs);
-
/**
* @ingroup kernel
*/
*/
int libevdev_get_repeat(const struct libevdev *dev, int *delay, int *period);
-
/********* DEPRECATED SECTION *********/
#if defined(__GNUC__) && __GNUC__ >= 4
#define LIBEVDEV_DEPRECATED __attribute__ ((deprecated))
#define DEFAULT_IDS NULL
-
struct uinput_device* uinput_device_new(const char *name);
int uinput_device_new_with_events(struct uinput_device **dev, const char *name, const struct input_id *ids, ...);
int uinput_device_new_with_events_v(struct uinput_device **dev, const char *name, const struct input_id *ids, va_list args);
#include "test-common-uinput.h"
-
int test_create_device(struct uinput_device **uidev,
struct libevdev **dev,
...);
abs[3].value = ABS_MT_POSITION_Y;
abs[3].maximum = 1000;
-
abs[4].value = ABS_MT_SLOT;
abs[4].maximum = 1;
abs[5].value = ABS_MT_TRACKING_ID;
abs[3].value = ABS_MT_POSITION_Y;
abs[3].maximum = 1000;
-
abs[4].value = ABS_MT_SLOT;
abs[4].maximum = 1;
abs[5].value = ABS_MT_TRACKING_ID;
}
}
-
/* Now we basically re-do the exact same test, just with the
tracking ID order inverted */
}
}
-
uinput_device_free(uidev);
libevdev_free(dev);
}
ck_assert_int_eq(libevdev_fetch_event_value(dev, EV_REL, REL_Z, &value), 0);
ck_assert_int_eq(value, 0xab);
-
uinput_device_free(uidev);
libevdev_free(dev);
return s;
}
-
rc = libevdev_new_from_fd(uinput_device_get_fd(uidev), &dev);
ck_assert_msg(rc == 0, "Failed to create device: %s", strerror(-rc));
-
for (i = 0; i < INPUT_PROP_CNT; i++) {
if (i == INPUT_PROP_DIRECT || i == INPUT_PROP_BUTTONPAD)
ck_assert_int_eq(libevdev_has_property(dev, i), 1);
uidev = uinput_device_new(TEST_DEVICE_NAME);
ck_assert(uidev != NULL);
-
abs.minimum = 0;
abs.maximum = 1000;
abs.fuzz = 1;
return s;
}
-
}
END_TEST
-
START_TEST(test_clock_id_events)
{
struct uinput_device* uidev;
return;
}
-
rc = libevdev_kernel_set_led_value(dev, led, state);
if (rc != 0)
fprintf(stderr,