binio
22nd March 2013, 01:12
Hello,
i want set and click the cursor outside from my Application (e.k. a game in windowsmode or a word dokument).
I have tested
QCursor::setPos(10,10);
to set my Mouseposition. Its work, the mousposition are outside on my widget and application(my application is only 1 px big).
but the click doesnt work :(
I have use/testing
#include <Windows.h>
...
mouse_event(MOUSEEVENTF_LEFTDOWN,0, 0, 0,0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0,0);
or
CONFIG += qtestlib
#include <QtTest/QTest>
...
QTestEventList *eventList=new QTestEventList();
eventList->addDelay(2000);
eventList->addMouseMove(QPoint(15,35));
eventList->addMouseClick(Qt::LeftButton,Qt::NoModifier,QPoint (15,35));
eventList->simulate(this);
but nothing work :(
Idont know what i can do.... can someone help me please ?
i want set and click the cursor outside from my Application (e.k. a game in windowsmode or a word dokument).
I have tested
QCursor::setPos(10,10);
to set my Mouseposition. Its work, the mousposition are outside on my widget and application(my application is only 1 px big).
but the click doesnt work :(
I have use/testing
#include <Windows.h>
...
mouse_event(MOUSEEVENTF_LEFTDOWN,0, 0, 0,0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0,0);
or
CONFIG += qtestlib
#include <QtTest/QTest>
...
QTestEventList *eventList=new QTestEventList();
eventList->addDelay(2000);
eventList->addMouseMove(QPoint(15,35));
eventList->addMouseClick(Qt::LeftButton,Qt::NoModifier,QPoint (15,35));
eventList->simulate(this);
but nothing work :(
Idont know what i can do.... can someone help me please ?