crosspad_input
Dispatch one input event to the running PC simulator—pad, encoder, click, drag, or key—and report click coordinates and hit object details.
Instructions
[PC sim] Send one input event to the running PC simulator (crosspad_run first): pad_press / pad_release, encoder_rotate / encoder_press / encoder_release, click, drag, key. action picks the event; fields it does not use are ignored. x, y (click) and x1..y2 (drag) are in LCD space by default (the 320x240 panel, as in a region='lcd' screenshot and the ENC_GROUP labels); space='window' means pixels of a region='full' capture. A click's reply reports where it landed in both spaces (window, lcd, in_lcd) and hit, the LVGL object class and LCD-space rect the press is delivered to (null = nothing under the pointer), so a click on empty background is not mistaken for one on a widget. A drag's reply comes at once, before the drag finishes (it takes ms + rest_ms); swipes (the top bar, the drawer) are drags, read the result with crosspad_stats view=top_bar.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "crosspad_input"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Required for action=click. X coordinate (0 = left) in `space`. | |
| y | No | Required for action=click. Y coordinate (0 = top) in `space`. | |
| ms | No | For action=drag: how long the pointer takes from start to end (simulator default applies when omitted). | |
| x1 | No | Required for action=drag. Start X in `space`. | |
| x2 | No | Required for action=drag. End X in `space`. | |
| y1 | No | Required for action=drag. Start Y in `space`. | |
| y2 | No | Required for action=drag. End Y in `space`. | |
| pad | No | Required for action=pad_press|pad_release. Pad index 0-15. | |
| port | No | Simulator control port (default: CROSSPAD_REMOTE_PORT of this server, else 19840). Needed to address a second instance. | |
| delta | No | Required for action=encoder_rotate. Positive=CW, negative=CCW. Typical range -10..10. | |
| space | No | For action=click: which space x,y are in. 'lcd' (default) = the 320x240 panel, as in a region='lcd' screenshot. 'window' = the whole emulator window, as in a region='full' screenshot. | lcd |
| steps | No | For action=drag: how many intermediate moves. | |
| action | Yes | Which input event to dispatch. Required params — pad_press: pad (velocity?); pad_release: pad; encoder_rotate: delta; encoder_press/encoder_release: (none); click: x,y; drag: x1,y1,x2,y2; key: keycode. | |
| hold_ms | No | For action=click: how long the button stays down. The simulator polls the pointer every ~30 ms, so 0 (press and release in one tick) is usually not seen as a click at all. | |
| keycode | No | Required for action=key. SDL keycode (e.g. 27=ESC, 32=SPACE, 13=RETURN). | |
| rest_ms | No | For action=drag: how long the pointer rests at the end before release. Longer than LVGL's momentum window, it lets go without a flick. | |
| velocity | No | Optional for action=pad_press (default 127). Ignored for other actions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| docs | No | ||
| next | No | ||
| error | No | ||
| action | No | ||
| notice | No | ||
| success | Yes | ||
| response | No |