- {l Code}: {l Select All Code}
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <linux/input.h>
FILE *mouse_file;
struct input_event event;
int main()
{
if(!(mouse_file = fopen("/dev/input/event4", "r")))
exit(-1);
read(fileno(mouse_file), &event, sizeof(struct input_event));
fread(&event, sizeof(struct input_event), 1, mouse_file);
return 0;
}
Can you tell me what's wrong?
EDIT: Solved! I use /dev/input/mice instead and it works