Feature: Add remote_mouse MCP tool
Add the remote_mouse tool to the MCP remote control surface, injecting mouse events (move / down / up / click / right_click / middle_click / drag / scroll) into an established remote_open session. Normalized 0..1 coordinates are mapped to physical pixels via the session's captured resolution and clamped to screen bounds. Scroll follows the existing web console's wheel sign convention (positive delta scrolls down) and is vertical-only. Extract BuildMouseMsg64 into WebService.h as a shared helper, reused by both the web console's HandleMouse and the new MCP handler so the two injection paths cannot drift. Co-Authored-By: deepseek-v4-pro
This commit is contained in:
@@ -48,6 +48,21 @@ inline MSG64 BuildKeyMsg64(int keyCode, bool isDown, bool isSysKey) {
|
||||
return msg64;
|
||||
}
|
||||
|
||||
// 构造单个鼠标注入 MSG64(复用 WebService::HandleMouse 的基座字段逻辑,抽取为共享 helper,
|
||||
// 供 Web 与 MCP 远程控制两处使用,见 docs/Mcp_RemoteControl_Design.md §6.2)。
|
||||
// x/y 为物理像素坐标(已由调用方从归一化坐标映射);message/wParam 由调用方按动作设定。
|
||||
inline MSG64 BuildMouseMsg64(int x, int y, UINT message, uint64_t wParam) {
|
||||
MSG64 msg64;
|
||||
memset(&msg64, 0, sizeof(MSG64));
|
||||
msg64.pt.x = x;
|
||||
msg64.pt.y = y;
|
||||
msg64.lParam = MAKELPARAM(x, y);
|
||||
msg64.time = GetTickCount();
|
||||
msg64.message = message;
|
||||
msg64.wParam = wParam;
|
||||
return msg64;
|
||||
}
|
||||
|
||||
// Web client state
|
||||
struct WebClient {
|
||||
std::string token;
|
||||
|
||||
Reference in New Issue
Block a user