问题
I'm writing a little mouselogger in basic C for linux. I search mouse event in linux/input.h, but I have not found anything about this.
struct input_event {
struct timeval time;
__u16 type;
__u16 code;
__s32 value;
}
With the struct input_event
, I can capturing which button was pressed on mouse and when she move, but not his position.
( I separate the field value in two __s16 variable, but is not a position).
If anyone know a structure where I can access this, or a specific file to listen (actually I'm listen /dev/input/event6
)...
Thank, bye !
回答1:
This page gives you step by step guidance on how do to exactly what you want.
来源:https://stackoverflow.com/questions/43272952/capturing-mouse-event-in-c-linux