欢迎来到键鼠自动化的世界!在这个快节奏的时代,时间对我们来说变得越来越宝贵。无论是日常办公、游戏竞技还是重复性的任务,我们都希望能够以更高效、智能的方式完成。那么,你是否曾经想过拥有一种强大的工具,能够帮助你自动化键盘和鼠标操作,释放你的双手和时间?
1. 支持键鼠所有按键: 支持随机坐标,随机延迟,支持录制,支持从变量获取坐标或者外部文件获取。
2. 支持图像查找功能: 支持自定义选取查找区域,自定义设置识别度和缩小率,支持逻辑判断和调试功能。
3. 支持文字查找功能: 直接选择区域获取文字,自带免费OCR文字识别,支持在线云识别,支持数据过滤,支持逻辑判断和调试功能。
4. 支持多线程功能: 可把脚本放置到多线程同时运行,支持脚本运行状态判断功能,支持多线程任务导入导出功能。
5. 支持逻辑判断功能: 可对内部变量进行任意判断和存储,判断OK或NG执行相应的操作。
6. 支持文本修改功能: 可选择一个或多个文本,进行批量处理,支持自定义设置某行,某个位置进行增删改查功能。
7. 键鼠自动化还支持: 1.后台点击 2.硬件配合点击 3.智能语音提示 4.邮箱提示 5.内部或外部数据运算 6.支持所有任务自定义按键7.支持任务log输出文本,log信息查看 8.支持脚本任务 9.支持双屏操作 10.支持截图功能 11.自动保存功能,等几十个实用功能…
void TaskThread::windowsMouseClick(MouseAction action, int x, int y)
{
if (m_IsBackRun) {
if (!IsWindow(m_WindowsInfo.hwnd)) {
if (m_WindowsInfo.isFindWindows) {
m_WindowsInfo.hwnd = getHwndFromWindowTitle(m_WindowsInfo.titleStr);
if (!IsWindow(m_WindowsInfo.hwnd)) {
emit Tools::getInstance()->sendStartOutputLog(m_Id, Status_TextError, QString("绑定的窗口不存在%1").arg(m_WindowsInfo.titleStr));
quitTask();
return;
}
}
else {
emit Tools::getInstance()->sendStartOutputLog(m_Id, Status_TextError, QString("绑定的窗口不存在%1").arg(m_WindowsInfo.titleStr));
quitTask();
return;
}
}
}
if (m_IsRunHeZi) {
if (!Tools::getInstance()->m_IsOpenHezi) {
emit Tools::getInstance()->sendStartOutputLog(m_Id, Status_TextError, QString("盒子打开失败!"));
quitTask();
return;
}
}
switch (action) {
case LeftClick: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
SendMessage(m_WindowsInfo.hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x, y));
SendMessage(m_WindowsInfo.hwnd, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
}
else if (m_IsRunHeZi) {
M_LeftClick(Tools::getInstance()->m_HDevice, 1);
}
else {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
}
break;
case LeftDown: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
POINT pt = {x, y};
HWND hwndChild = ChildWindowFromPoint(m_WindowsInfo.hwnd, pt);
if (hwndChild != NULL) {
SendMessage(m_WindowsInfo.hwnd, WM_LBUTTONDOWN, MK_LBUTTON, MAKELPARAM(x, y));
}
}
else if (m_IsRunHeZi) {
M_LeftDown(Tools::getInstance()->m_HDevice);
}
else {
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
}
}
break;
case LeftUp: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
POINT pt = {x, y};
HWND hwndChild = ChildWindowFromPoint(m_WindowsInfo.hwnd, pt);
if (hwndChild != NULL) {
SendMessage(m_WindowsInfo.hwnd, WM_LBUTTONUP, 0, MAKELPARAM(x, y));
}
}
else if (m_IsRunHeZi) {
M_LeftUp(Tools::getInstance()->m_HDevice);
}
else {
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
}
break;
case RightClick: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
SendMessage(m_WindowsInfo.hwnd, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(x, y));
SendMessage(m_WindowsInfo.hwnd, WM_RBUTTONUP, 0, MAKELPARAM(x, y));
}
else if (m_IsRunHeZi) {
M_RightClick(Tools::getInstance()->m_HDevice, 1);
}
else {
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
}
}
break;
case RightDown: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
SendMessage(m_WindowsInfo.hwnd, WM_RBUTTONDOWN, MK_RBUTTON, MAKELPARAM(x, y));
}
else if (m_IsRunHeZi) {
M_RightDown(Tools::getInstance()->m_HDevice);
}
else {
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
}
}
break;
case RightUp: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
SendMessage(m_WindowsInfo.hwnd, WM_RBUTTONUP, 0, MAKELPARAM(x, y));
}
else if (m_IsRunHeZi) {
M_RightUp(Tools::getInstance()->m_HDevice);
}
else {
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
}
}
break;
case WheelClick: {
if (m_IsBackRun) {
SendMessage(m_WindowsInfo.hwnd, WM_MBUTTONDOWN, WM_MBUTTONDOWN, MAKELPARAM(x, y));
SendMessage(m_WindowsInfo.hwnd, WM_MBUTTONUP, 0, MAKELPARAM(x, y));
}
else if (m_IsRunHeZi) {
M_MiddleClick(Tools::getInstance()->m_HDevice, 1);
}
else {
mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0);
}
}
break;
case WheelDownClick: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
SendMessage(m_WindowsInfo.hwnd, WM_MBUTTONDOWN, MK_MBUTTON, MAKELPARAM(x, y));
}
else if (m_IsRunHeZi) {
M_MiddleDown(Tools::getInstance()->m_HDevice);
}
else {
mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0);
}
}
break;
case WheelUpClick: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
SendMessage(m_WindowsInfo.hwnd, WM_MBUTTONUP, 0, MAKELPARAM(x, y));
}
else if (m_IsRunHeZi) {
M_MiddleUp(Tools::getInstance()->m_HDevice);
}
else {
mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0);
}
}
break;
case WheelDownGun: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
// 发送滚动消息给窗口
POINT pt = { x, y };
HWND hwndChild = ChildWindowFromPoint(m_WindowsInfo.hwnd, pt);
if (hwndChild != NULL) {
SendMessage(hwndChild, WM_MOUSEWHEEL, MAKEWPARAM(0, -WHEEL_DELTA), MAKELPARAM(x, y));
}
}
else if (m_IsRunHeZi) {
M_MouseWheel(Tools::getInstance()->m_HDevice, 1);
}
else {
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -120, 0);
}
}
break;
case WheelUpGun: {
if (m_IsBackRun && !m_WindowsInfo.isClickQianTai) {
// 发送滚动消息给窗口
POINT pt = {x, y};
HWND hwndChild = ChildWindowFromPoint(m_WindowsInfo.hwnd, pt);
if (hwndChild != NULL) {
SendMessage(hwndChild, WM_MOUSEWHEEL, MAKEWPARAM(0, WHEEL_DELTA), MAKELPARAM(x, y));
}
}
else if (m_IsRunHeZi) {
M_MouseWheel(Tools::getInstance()->m_HDevice, -1);
}
else {
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, 120, 0);
}
}
break;
case XBUTTON1Click: {
INPUT input;
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_XDOWN;
input.mi.mouseData = XBUTTON1;
// 模拟鼠标侧键1(前侧键)按下
SendInput(1, &input, sizeof(INPUT));
// 模拟鼠标侧键1(前侧键)释放
input.mi.dwFlags = MOUSEEVENTF_XUP;
SendInput(1, &input, sizeof(INPUT));
}
break;
case XBUTTON1Down: {
INPUT input;
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_XDOWN;
input.mi.mouseData = XBUTTON1;
// 模拟鼠标侧键1(前侧键)按下
SendInput(1, &input, sizeof(INPUT));
}
break;
case XBUTTON1Up: {
INPUT input;
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_XDOWN;
input.mi.mouseData = XBUTTON1;
// 模拟鼠标侧键1(前侧键)释放
input.mi.dwFlags = MOUSEEVENTF_XUP;
SendInput(1, &input, sizeof(INPUT));
}
break;
case XBUTTON2Click: {
INPUT input;
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_XDOWN;
input.mi.mouseData = XBUTTON2;
// 模拟鼠标侧键2(前侧键)按下
SendInput(1, &input, sizeof(INPUT));
// 模拟鼠标侧键2(前侧键)释放
input.mi.dwFlags = MOUSEEVENTF_XUP;
SendInput(1, &input, sizeof(INPUT));
}
break;
case XBUTTON2Down: {
INPUT input;
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_XDOWN;
input.mi.mouseData = XBUTTON2;
// 模拟鼠标侧键2(前侧键)按下
SendInput(1, &input, sizeof(INPUT));
}
break;
case XBUTTON2Up: {
INPUT input;
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_XDOWN;
input.mi.mouseData = XBUTTON2;
// 模拟鼠标侧键2(前侧键)释放
input.mi.dwFlags = MOUSEEVENTF_XUP;
SendInput(1, &input, sizeof(INPUT));
}
break;
case MouseMove: {
windowsMouseMove(x, y); //移动鼠标
}
break;
default:
break;
}
}
下载链接: jsautotask.com