[SOLVED] Problem reading simulated touch events from /dev/input/event1
-
Hello All,
I have created GUI application for my custom board.
with environment variable export QWS_MOUSE_PROTO=tslib:/dev/input/event0 it works fine for manual touch.Now i wanted to create simulation of frequent touch events for application testing.
So I created one test application which creates touch events and writes in /dev/uinput and this events are automatically re-directed by kernel to /dev/input/event1. Now starts the problem that I can see event by cat /dev/input/event1 but application doesn't get any.Any hint, clue, solution.?
-
Hello Guys...
Found an error in my simulator code.
Actually I was writing touch release event as...
@
struct input_event ev_release[] =
{
{{ 0, 0 }, EV_KEY, BTN_TOUCH, 0 }
};
@I changed above piece of code to...
@
struct input_event ev_release[] =
{
{ { 0, 0 }, EV_KEY, BTN_TOUCH, 0 },
{ { 0, 0 }, EV_ABS, ABS_X, x },
{ { 0, 0 }, EV_ABS, ABS_Y, y },
{ { 0, 0 }, EV_ABS, ABS_PRESSURE, p },
{ { 0, 0 }, EV_SYN, SYN_REPORT, 0 },
};
@... and it worked. :)
So maybe Qt doesn't accept touch/mouse events without coordinates, I assume.
Correct me if I am wrong. -
Hi aekam,
Currently im in a similar situation of simulating touch events by emulating the touch co-ordiantes into the driver.. im new to QT and drivers.. Saw this post as solved,Hence requesting you to help me -
@aekam Hi,
I'm working with uinput to simulate a touch driver using embedded linux on sama board.
I set TSLIB_TSDEVICE=/dev/input/event0, but QT seems not working.
I can see event by cat /dev/input/event0 but application doesn't get any.
My question is: why do you have a release event?
My code isemit(fd, EV_KEY, BTN_TOUCH, 1); emit(fd, EV_ABS, ABS_X, point.x); emit(fd, EV_ABS, ABS_Y, point.y); emit(fd, EV_SYN, SYN_REPORT, 0);
where emit is defined
void emit(int fd, int type, int code, int val) {
struct input_event ie;
ie.type = type;
ie.code = code;
ie.value = val;
write(fd, &ie, sizeof(ie));
}Any help is greatly appreciated.
Thanks