File indexing completed on 2024-04-21 05:25:18

0001 #include "emulatedmouse.h"
0002 #include <QProcess>
0003 
0004 EmulatedMouse::EmulatedMouse(QObject *parent)
0005     : QObject(parent)
0006 {
0007 }
0008 
0009 void EmulatedMouse::moveMouseEvent(int posX, int posY)
0010 {
0011     QStringList args;
0012     args << QStringLiteral("mousemove") << QString::number(posX) << QString::number(posY);
0013     QProcess::execute(QStringLiteral("xdotool"), args);
0014 }
0015 
0016 void EmulatedMouse::mouseClickEvent()
0017 {
0018     QStringList args;
0019     args << QStringLiteral("click") << QStringLiteral("1");
0020     QProcess::execute(QStringLiteral("xdotool"), args);
0021 }