1. 实现单次对话功能,支持语音录制和数据传输

2. 优化静音检测算法,改进RMS平滑处理
3. 添加自动化代理处理,支持点击、拖拽、输入等操作
4. 修复多屏幕环境下鼠标定位问题
This commit is contained in:
Misaki
2026-02-03 01:29:41 +08:00
parent 015ef0f962
commit 46da4870c9
15 changed files with 342 additions and 55 deletions
@@ -42,24 +42,40 @@ AutoAgentHandle::~AutoAgentHandle()
}
void AutoAgentHandle::onAutoAgentPacketReceived(const AutoAgentDataObject &packet) {
qDebug() << "Received AutoAgent packet: " << packet.getAction();
if (packet.getAction() == "click") { // 单击
qDebug() << "Click: " << packet.getX1() << ", " << packet.getY1();
AutoGUI::moveTo(packet.getX1(), packet.getY1(), 0.6);
AutoGUI::moveToOnCurrentScreen(packet.getX1(), packet.getY1(), 0.6);
AutoGUI::click(packet.getX1(), packet.getY1());
}
if (packet.getAction() == "left_double") { // 双击
qDebug() << "Double click: " << packet.getX1() << ", " << packet.getY1();
AutoGUI::moveTo(packet.getX1(), packet.getY1(), 0.6);
AutoGUI::moveToOnCurrentScreen(packet.getX1(), packet.getY1(), 0.6);
AutoGUI::leftDouble(packet.getX1(), packet.getY1());
}
if (packet.getAction() == "right_single") { // 右键单击
qDebug() << "Right click: " << packet.getX1() << ", " << packet.getY1();
AutoGUI::moveTo(packet.getX1(), packet.getY1(), 0.6);
AutoGUI::moveToOnCurrentScreen(packet.getX1(), packet.getY1(), 0.6);
AutoGUI::rightSingle(packet.getX1(), packet.getY1());
}
if (packet.getAction() == "drag") { // 拖拽
qDebug() << "Drag: " << packet.getX1() << ", " << packet.getY1() << " to " << packet.getX2() << ", " << packet.getY2();
AutoGUI::drag(packet.getX1(), packet.getY1(), packet.getX2(), packet.getY2(), 0.8);
AutoGUI::drag(packet.getX1(), packet.getY1(), packet.getX2(), packet.getY2(), 1.2);
}
// TODO: 快捷键,输入文本,滚动待实现
}
if (packet.getAction() == "type") { // 输入文本
qDebug() << "Type: " << packet.getContent();
AutoGUI::type(packet.getContent().toStdString(), 0.08);
}
if (packet.getAction() == "scroll") { // 滚动
qDebug() << "Scroll: " << packet.getX1() << ", " << packet.getY1() << packet.getDirection();
if (packet.getDirection() == "up") {
AutoGUI::moveToOnCurrentScreen(packet.getX1(), packet.getY1(), 0.1);
AutoGUI::scroll(40, 1);
}
if (packet.getDirection() == "down") {
AutoGUI::moveToOnCurrentScreen(packet.getX1(), packet.getY1(), 0.1);
AutoGUI::scroll(40, -1);
}
}
}