return write(sock, buf, n);
}
+static inline int litest_slot_count(struct litest_device *dev)
+{
+ return libevdev_get_num_slots(dev->evdev);
+}
+
#endif /* LITEST_H */
{ -30, 30 },
};
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
dir_x = cardinals[cardinal][0];
{ -30, 30 },
};
- if (libevdev_get_num_slots(dev->evdev) > 2 ||
+ if (litest_slot_count(dev) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP) ||
!libinput_device_has_capability(dev->libinput_device,
LIBINPUT_DEVICE_CAP_GESTURE))
struct libinput_event *event;
struct libinput_event_gesture *gevent;
- if (libevdev_get_num_slots(dev->evdev) > 2 ||
+ if (litest_slot_count(dev) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP) ||
!libinput_device_has_capability(dev->libinput_device,
LIBINPUT_DEVICE_CAP_GESTURE))
};
int i;
- if (libevdev_get_num_slots(dev->evdev) < 4)
+ if (litest_slot_count(dev) < 4)
return;
dir_x = cardinals[cardinal][0];
{ -30, 30 },
};
- if (libevdev_get_num_slots(dev->evdev) > 2 ||
+ if (litest_slot_count(dev) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_QUADTAP) ||
!libinput_device_has_capability(dev->libinput_device,
LIBINPUT_DEVICE_CAP_GESTURE))
{ -30, 30 },
};
- if (libevdev_get_num_slots(dev->evdev) < 2 ||
+ if (litest_slot_count(dev) < 2 ||
!libinput_device_has_capability(dev->libinput_device,
LIBINPUT_DEVICE_CAP_GESTURE))
return;
{ -30, 30 },
};
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
dir_x = cardinals[cardinal][0];
{ -30, 30 },
};
- if (libevdev_get_num_slots(dev->evdev) < 4)
+ if (litest_slot_count(dev) < 4)
return;
dir_x = cardinals[cardinal][0];
{ -30, 30 },
};
- if (libevdev_get_num_slots(dev->evdev) < 2 ||
+ if (litest_slot_count(dev) < 2 ||
!libinput_device_has_capability(dev->libinput_device,
LIBINPUT_DEVICE_CAP_GESTURE))
return;
struct libinput_event_gesture *gevent;
uint64_t time_usec;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_drain_events(li);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_enable_buttonareas(dev);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) > 2)
+ if (litest_slot_count(dev) > 2)
return;
litest_enable_buttonareas(dev);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_enable_clickfinger(dev);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) >= 3 ||
+ if (litest_slot_count(dev) >= 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
struct libinput *li = dev->libinput;
struct libinput_event *event;
- if (libevdev_get_num_slots(dev->evdev) < 4)
+ if (litest_slot_count(dev) < 4)
return;
litest_enable_clickfinger(dev);
struct libinput *li = dev->libinput;
struct libinput_event *event;
- if (libevdev_get_num_slots(dev->evdev) >= 3 ||
+ if (litest_slot_count(dev) >= 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_QUADTAP))
return;
struct libinput *li = dev->libinput;
struct libinput_event *event;
- if (libevdev_get_num_slots(dev->evdev) != 3 ||
+ if (litest_slot_count(dev) != 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_enable_clickfinger(dev);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) > 2)
+ if (litest_slot_count(dev) > 2)
return;
litest_enable_clickfinger(dev);
struct libinput *li = dev->libinput;
int nfingers = _i; /* ranged test */
unsigned int button;
- int nslots = libevdev_get_num_slots(dev->evdev);
+ int nslots = litest_slot_count(dev);
litest_enable_clickfinger(dev);
litest_drain_events(li);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) > 2 ||
+ if (litest_slot_count(dev) > 2 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_enable_tap(dev->libinput_device);
unsigned int button = 0;
int i;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_enable_tap(dev->libinput_device);
struct libinput *li = dev->libinput;
int i;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_enable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
litest_enable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) >= 3 ||
+ if (litest_slot_count(dev) >= 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) >= 3 ||
+ if (litest_slot_count(dev) >= 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
enum libinput_config_tap_button_map map = _i; /* ranged test */
unsigned int button = 0;
- if (libevdev_get_num_slots(dev->evdev) > 3 ||
+ if (litest_slot_count(dev) >= 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
enum libinput_config_tap_button_map map = _i; /* ranged test */
unsigned int button = 0;
- if (libevdev_get_num_slots(dev->evdev) > 3 ||
+ if (litest_slot_count(dev) > 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
enum libinput_config_tap_button_map map = _i; /* ranged test */
unsigned int button = 0;
- if (libevdev_get_num_slots(dev->evdev) > 3 ||
+ if (litest_slot_count(dev) > 3 ||
!libevdev_has_event_code(dev->evdev, EV_KEY, BTN_TOOL_TRIPLETAP))
return;
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) <= 3)
+ if (litest_slot_count(dev) <= 3)
return;
litest_enable_2fg_scroll(dev);
struct libinput *li = dev->libinput;
int i;
- if (libevdev_get_num_slots(dev->evdev) <= 4)
+ if (litest_slot_count(dev) <= 4)
return;
litest_enable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) <= 4)
+ if (litest_slot_count(dev) <= 4)
return;
litest_enable_tap(dev->libinput_device);
struct libinput *li = dev->libinput;
int nfingers = _i; /* ranged test */
- if (nfingers > libevdev_get_num_slots(dev->evdev))
+ if (nfingers > litest_slot_count(dev))
return;
litest_enable_tap(dev->libinput_device);
struct libinput *li = dev->libinput;
int i;
- if (libevdev_get_num_slots(dev->evdev) < 5)
+ if (litest_slot_count(dev) < 5)
return;
litest_enable_tap(dev->libinput_device);
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- if (libevdev_get_num_slots(dev->evdev) < 5)
+ if (litest_slot_count(dev) < 5)
return;
litest_enable_tap(dev->libinput_device);
int which = _i; /* ranged test */
int this = which % 3;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
if (!touchpad_has_palm_pressure(dev))
int which = _i; /* ranged test */
int this = which % 3;
- if (libevdev_get_num_slots(dev->evdev) < 3)
+ if (litest_slot_count(dev) < 3)
return;
if (!touchpad_has_palm_pressure(dev))
int which = _i; /* ranged test */
int this = which % 4;
- if (libevdev_get_num_slots(dev->evdev) < 4)
+ if (litest_slot_count(dev) < 4)
return;
if (!touchpad_has_palm_pressure(dev))