360 Secure SkillHub
360 安全技能中心

mouse-keyboard

该技能说明如何在 macOS 上调用 cliclick 执行鼠标移动、点击、双击、右键、文本输入、按键和等待等操作,并给出常见命令组合与坐标获取方法;依赖本地 cliclick 可执行文件。

calvin-dean
calvin-dean
热度 75.38
最近更新 2026-05-11 17:35:07
分类:自动化依赖:代码执行应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add mouse-keyboard
Metadata
name
mouse-keyboard
description
Control mouse and keyboard on Mac using cliclick. Use when you need to automate clicking, typing, or controlling the mouse cursor.

Mouse & Keyboard Control

Use cliclick tool for mouse/keyboard automation on Mac.

Tools

exec

Use exec to run cliclick commands.

Available Commands

  • c:X,Y - Click at coordinates X,Y
  • c:~100,~200 - Click at relative position
  • w:500 - Wait 500ms
  • t:hello - Type "hello"
  • kd:cmd - Key down command
  • ku:cmd - Key up command
  • p:return - Press return/enter
  • p:space - Press space
  • p:tab - Press tab
  • m:X,Y - Move mouse to X,Y
  • dp - Double click
  • rc:X,Y - Right click at X,Y

Common Workflows

Click at position

cliclick c:500,300

Type text

cliclick t:Hello World

Click and type

cliclick c:500,300 && cliclick t:username

Keyboard shortcut

cliclick kd:cmd ku:cmd  # Press cmd

Move and click

cliclick m:100,100 && cliclick c:100,100

Getting Coordinates

Use cliclick p to print current mouse position, or use macOS screenshot tool (Shift+Cmd+4) to get coordinates.

Notes

  • Coordinates are screen-based (0,0 is top-left)
  • Use osascript for more complex keyboard operations
  • Combine with sleep for timing