ghost
ghost

Reputation: 23

capturing mouse event in C (linux)

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 !

Upvotes: 0

Views: 4731

Answers (1)

Neil
Neil

Reputation: 11889

This page gives you step by step guidance on how do to exactly what you want.

Upvotes: 2

Related Questions