diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/mtdev-test.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/mtdev-test.c b/test/mtdev-test.c index b8e56d5..1b3e4f2 100644 --- a/test/mtdev-test.c +++ b/test/mtdev-test.c | |||
| @@ -54,6 +54,28 @@ static void print_event(const struct input_event *ev) | |||
| 54 | evtime, slot, ev->type, ev->code, ev->value); | 54 | evtime, slot, ev->type, ev->code, ev->value); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | #define CHECK(dev, name) \ | ||
| 58 | if (mtdev_has_mt_event(dev, name)) \ | ||
| 59 | fprintf(stderr, " %s\n", #name) | ||
| 60 | |||
| 61 | static void show_props(const struct mtdev *dev) | ||
| 62 | { | ||
| 63 | fprintf(stderr, "supported mt events:\n"); | ||
| 64 | CHECK(dev, ABS_MT_SLOT); | ||
| 65 | CHECK(dev, ABS_MT_TOUCH_MAJOR); | ||
| 66 | CHECK(dev, ABS_MT_TOUCH_MINOR); | ||
| 67 | CHECK(dev, ABS_MT_WIDTH_MAJOR); | ||
| 68 | CHECK(dev, ABS_MT_WIDTH_MINOR); | ||
| 69 | CHECK(dev, ABS_MT_ORIENTATION); | ||
| 70 | CHECK(dev, ABS_MT_POSITION_X); | ||
| 71 | CHECK(dev, ABS_MT_POSITION_Y); | ||
| 72 | CHECK(dev, ABS_MT_TOOL_TYPE); | ||
| 73 | CHECK(dev, ABS_MT_BLOB_ID); | ||
| 74 | CHECK(dev, ABS_MT_TRACKING_ID); | ||
| 75 | CHECK(dev, ABS_MT_PRESSURE); | ||
| 76 | CHECK(dev, ABS_MT_DISTANCE); | ||
| 77 | } | ||
| 78 | |||
| 57 | static void loop_device(int fd) | 79 | static void loop_device(int fd) |
| 58 | { | 80 | { |
| 59 | struct mtdev dev; | 81 | struct mtdev dev; |
| @@ -63,6 +85,7 @@ static void loop_device(int fd) | |||
| 63 | fprintf(stderr, "error: could not open device: %d\n", ret); | 85 | fprintf(stderr, "error: could not open device: %d\n", ret); |
| 64 | return; | 86 | return; |
| 65 | } | 87 | } |
| 88 | show_props(&dev); | ||
| 66 | /* while the device has not been inactive for five seconds */ | 89 | /* while the device has not been inactive for five seconds */ |
| 67 | while (!mtdev_idle(&dev, fd, 5000)) { | 90 | while (!mtdev_idle(&dev, fd, 5000)) { |
| 68 | /* extract all available processed events */ | 91 | /* extract all available processed events */ |
