diff --git a/test/litest.c b/test/litest.c index 78ef5dfc..00336a74 100644 --- a/test/litest.c +++ b/test/litest.c @@ -3248,6 +3248,26 @@ litest_pop_event_frame(struct litest_device *dev) litest_event(dev, EV_SYN, SYN_REPORT, 0); } +void +litest_filter_event(struct litest_device *dev, + unsigned int type, + unsigned int code) +{ + libevdev_disable_event_code(dev->evdev, type, code); +} + +void +litest_unfilter_event(struct litest_device *dev, + unsigned int type, + unsigned int code) +{ + /* would need an non-NULL argument for re-enabling, so simply abort + * until we need to be more sophisticated */ + litest_assert(type != EV_ABS); + + libevdev_enable_event_code(dev->evdev, type, code, NULL); +} + static void send_abs_xy(struct litest_device *d, double x, double y) { diff --git a/test/litest.h b/test/litest.h index d6b0ef0e..f5d91b91 100644 --- a/test/litest.h +++ b/test/litest.h @@ -707,6 +707,15 @@ litest_push_event_frame(struct litest_device *dev); void litest_pop_event_frame(struct litest_device *dev); +void +litest_filter_event(struct litest_device *dev, + unsigned int type, + unsigned int code); + +void +litest_unfilter_event(struct litest_device *dev, + unsigned int type, + unsigned int code); void litest_semi_mt_touch_down(struct litest_device *d, struct litest_semi_mt *semi_mt,