Commit 49d66828 by NitefullWind

1. 临时版本:数据传输完毕后向屏幕发送鼠标点击事件解决POS获取不到焦点问题。

parent 1cb233de
......@@ -2,6 +2,8 @@
#include "fmvipdispatcher.h"
#include "fmp_vip_settings.h"
#include <QTcpSocket>
#include <Windows.h>
#include <QDesktopWidget>
#include <QDebug>
FMPVipServer *FMPVipServer::instance()
......@@ -18,6 +20,8 @@ FMPVipServer::FMPVipServer() :
Listen(23770);
connect(this, &QTcpServer::newConnection, this, &FMPVipServer::onNewConnection);
isNeedSocketHeader = FMPVipSettings::instance()->getIsNeedSocketHeader();
_centerPoint = QPoint(qApp->desktop()->width()/2, qApp->desktop()->height()/2);
}
void FMPVipServer::Listen(quint16 port)
......@@ -76,4 +80,8 @@ void FMPVipServer::onReadyRead()
socket->close();
socket->deleteLater();
socket = nullptr;
//! WARNING 这是一个临时版本,以解决POS接收消息后获取不到焦点问题。
mouse_event(MOUSEEVENTF_LEFTDOWN, _centerPoint.x(), _centerPoint.y(),0,0);
mouse_event(MOUSEEVENTF_LEFTUP, _centerPoint.x(), _centerPoint.y(),0,0);
}
......@@ -36,6 +36,8 @@ private:
FMVipDispatcher *dispatcher;
bool isNeedSocketHeader;
QPoint _centerPoint;
};
#endif // FMP_VIP_SERVER_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment