Changeset View
Changeset View
Standalone View
Standalone View
autotests/faketablet/faketablet.cpp
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #include <iostream> | 20 | #include <iostream> | ||
21 | #include <cstring> | 21 | #include <cstring> | ||
22 | #include <cstdio> | 22 | #include <cstdio> | ||
23 | #include <cstdlib> | 23 | #include <cstdlib> | ||
24 | #include <csignal> | 24 | #include <csignal> | ||
25 | #include <unistd.h> | 25 | #include <unistd.h> | ||
26 | #include <fcntl.h> | 26 | #include <fcntl.h> | ||
27 | | ||||
28 | #if __FreeBSD__ | ||||
29 | # include <dev/evdev/input.h> | ||||
30 | # include <dev/evdev/uinput.h> | ||||
31 | #else | ||||
27 | #include <linux/input.h> | 32 | # include <linux/input.h> | ||
28 | #include <linux/uinput.h> | 33 | # include <linux/uinput.h> | ||
34 | #endif | ||||
35 | | ||||
29 | 36 | | |||
30 | // edit uidev.id.product to change tablet id | 37 | // edit uidev.id.product to change tablet id | ||
31 | 38 | | |||
32 | void check(int ioctlresult, const std::string &errormsg) { | 39 | void check(int ioctlresult, const std::string &errormsg) { | ||
33 | if (ioctlresult < 0) { | 40 | if (ioctlresult < 0) { | ||
34 | std::cout << "ioctl failed: " << errormsg << std::endl; | 41 | std::cout << "ioctl failed: " << errormsg << std::endl; | ||
35 | exit(-1); | 42 | exit(-1); | ||
36 | } | 43 | } | ||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |