mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-07-03 14:32:44 +08:00
将发送文本从消息通知移到模拟操作,增加模拟粘贴选项
This commit is contained in:
parent
7a43695e2d
commit
6af4a15e2a
@ -1,7 +1,9 @@
|
|||||||
const { findImage } = require("./imageFinder");
|
const { findImage } = require("./imageFinder");
|
||||||
const { captureScreen } = require("./screenCapture");
|
const { captureScreen } = require("./screenCapture");
|
||||||
|
const sendText = require("./sendText");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
findImage,
|
findImage,
|
||||||
captureScreen,
|
captureScreen,
|
||||||
|
sendText,
|
||||||
};
|
};
|
||||||
|
11
plugin/lib/quickcomposer/simulate/sendText.js
Normal file
11
plugin/lib/quickcomposer/simulate/sendText.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
const sendText = (text, simulateCopy = false) => {
|
||||||
|
if (simulateCopy) {
|
||||||
|
window.utools.copyText(text);
|
||||||
|
quickcommand.sleep(200);
|
||||||
|
quickcommand.simulatePaste();
|
||||||
|
} else {
|
||||||
|
window.utools.hideMainWindowTypeString(text);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = sendText;
|
@ -5,7 +5,7 @@ export const notifyCommands = {
|
|||||||
commands: [
|
commands: [
|
||||||
{
|
{
|
||||||
value: "console.log",
|
value: "console.log",
|
||||||
label: "打印消息",
|
label: "显示消息",
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
key: "log",
|
key: "log",
|
||||||
@ -27,17 +27,5 @@ export const notifyCommands = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: "utools.hideMainWindowTypeString",
|
|
||||||
label: "发送文本到活动窗口",
|
|
||||||
config: [
|
|
||||||
{
|
|
||||||
key: "text",
|
|
||||||
label: "要发送到窗口的文本内容",
|
|
||||||
type: "varInput",
|
|
||||||
icon: "send",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
@ -9,10 +9,33 @@ export const simulateCommands = {
|
|||||||
config: [],
|
config: [],
|
||||||
component: "KeyEditor",
|
component: "KeyEditor",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
value: "quickcomposer.simulate.sendText",
|
||||||
|
label: "发送文本",
|
||||||
|
config: [
|
||||||
|
{
|
||||||
|
key: "text",
|
||||||
|
label: "要发送的文本内容",
|
||||||
|
type: "varInput",
|
||||||
|
icon: "send",
|
||||||
|
width: 9,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "发送方式",
|
||||||
|
type: "select",
|
||||||
|
defaultValue: false,
|
||||||
|
icon: "keyboard",
|
||||||
|
options: [
|
||||||
|
{ label: "模拟输入", value: false },
|
||||||
|
{ label: "模拟粘贴", value: true },
|
||||||
|
],
|
||||||
|
width: 3,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
value: "utools.simulateMouseClick",
|
value: "utools.simulateMouseClick",
|
||||||
label: "鼠标点击",
|
label: "鼠标点击",
|
||||||
allowEmptyArgv: true,
|
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
label: "X坐标(留空则原地点击)",
|
label: "X坐标(留空则原地点击)",
|
||||||
@ -47,32 +70,36 @@ export const simulateCommands = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "utools.simulateMouseMove",
|
value: "utools.simulateMouseMove",
|
||||||
label: "鼠标移动",
|
label: "鼠标位置",
|
||||||
config: [
|
functionSelector: [
|
||||||
{
|
{
|
||||||
label: "X坐标",
|
label: "移动到坐标",
|
||||||
icon: "drag_handle",
|
value: "utools.simulateMouseMove",
|
||||||
defaultValue: 0,
|
icon: "mouse",
|
||||||
type: "numInput",
|
config: [
|
||||||
width: 6,
|
{
|
||||||
|
label: "X坐标",
|
||||||
|
icon: "drag_handle",
|
||||||
|
defaultValue: 0,
|
||||||
|
type: "numInput",
|
||||||
|
width: 6,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Y坐标",
|
||||||
|
icon: "drag_handle",
|
||||||
|
defaultValue: 0,
|
||||||
|
type: "numInput",
|
||||||
|
width: 6,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Y坐标",
|
label: "获取坐标",
|
||||||
icon: "drag_handle",
|
value: "utools.getCursorScreenPoint",
|
||||||
defaultValue: 0,
|
icon: "mouse",
|
||||||
type: "numInput",
|
|
||||||
width: 6,
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: "utools.getCursorScreenPoint",
|
|
||||||
label: "获取鼠标坐标",
|
|
||||||
outputVariable: "{x:curX,y:curY}",
|
|
||||||
saveOutput: true,
|
|
||||||
config: [],
|
|
||||||
allowEmptyArgv: true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
value: "quickcomposer.simulate.findImage",
|
value: "quickcomposer.simulate.findImage",
|
||||||
label: "屏幕找图",
|
label: "屏幕找图",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user