From 823d499e4f57151b8ded478727b102b53941436f Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 30 Apr 2023 17:39:21 +0300 Subject: like 350 lines total of scripts and makefile --- src/tests/test3.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/tests/test3.c (limited to 'src/tests') diff --git a/src/tests/test3.c b/src/tests/test3.c new file mode 100644 index 0000000..d3bcf4a --- /dev/null +++ b/src/tests/test3.c @@ -0,0 +1,50 @@ +int main(void) +{ + return 0; +} + +// This code is to simulate key presses + +// #include +// #include +// #include +// #include + +// int main() +// { +// int fd = open("/dev/input/event0", O_WRONLY | O_NONBLOCK); +// if (fd < 0) { +// perror("Failed to open device"); +// return 1; +// } + +// struct input_event event; +// memset(&event, 0, sizeof(event)); +// event.type = EV_KEY; +// event.code = KEY_A; +// event.value = 1; // Key press +// gettimeofday(&event.time, NULL); + +// ssize_t ret = write(fd, &event, sizeof(event)); +// if (ret < 0) { +// perror("Failed to write event"); +// close(fd); +// return 1; +// } + +// memset(&event, 0, sizeof(event)); +// event.type = EV_SYN; +// event.code = SYN_REPORT; +// event.value = 0; +// gettimeofday(&event.time, NULL); + +// ret = write(fd, &event, sizeof(event)); +// if (ret < 0) { +// perror("Failed to write sync event"); +// close(fd); +// return 1; +// } + +// close(fd); +// return 0; +// } -- cgit v1.2.3