mouse_click
Perform mouse clicks to automate Windows interactions, supporting left, right, or middle button clicks with optional double-click functionality.
Instructions
鼠标点击
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| button | No | 按钮类型 | |
| double | No | 是否双击(可选) |
Input Schema (JSON Schema)
{
"properties": {
"button": {
"description": "按钮类型",
"enum": [
"left",
"right",
"middle"
],
"type": "string"
},
"double": {
"description": "是否双击(可选)",
"type": "boolean"
}
},
"type": "object"
}
Implementation Reference
- src/tools/mouse-keyboard.js:138-145 (handler)The `mouseClick` method implements the core logic for performing a mouse click (single or double) using the robotjs library.mouseClick(button = 'left', double = false) { try { this.robot.mouseClick(button, double); return { success: true, button, double, message: '点击完成' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/mouse-keyboard.js:39-49 (schema)Tool definition in `getToolDefinitions()` including the input schema for the 'mouse_click' tool.{ name: 'mouse_click', description: '鼠标点击', inputSchema: { type: 'object', properties: { button: { type: 'string', enum: ['left', 'right', 'middle'], description: '按钮类型' }, double: { type: 'boolean', description: '是否双击(可选)' }, }, }, },
- src/tools/mouse-keyboard.js:110-111 (registration)The dispatch case in `executeTool` method that routes 'mouse_click' calls to the handler.case 'mouse_click': return this.mouseClick(args.button, args.double);
- src/tools/mouse-keyboard.js:94-95 (helper)The list of supported tools in `canHandle` method used for routing in the server.const tools = ['move_mouse', 'mouse_click', 'type_text', 'press_key', 'get_mouse_position', 'get_screen_size'];
- src/server.js:46-46 (registration)Instantiation of MouseKeyboardTools class in the main server, enabling its tools.mouseKeyboard: new MouseKeyboardTools(),