simulator_input
MCP टूल जो टीम के Simulator को एक raw input event भेजता है, उन gestures के लिए जो बाकी इनपुट टूल कवर नहीं करते।
simulator_input टीम के चल रहे Simulator को एक raw input event भेजता है। इसे उन कामों के लिए इस्तेमाल करें जो बाकी टूल नहीं करते: कई कॉल तक दबाकर रखा गया touch, दो उँगलियों से pinch, या स्क्रीन के किनारे से अंदर की ओर swipe। एक पूरा gesture कई events होता है (down, एक या ज़्यादा moves, up), इसलिए उन्हें क्रम से भेजें, या simulator_batch के input steps के रूप में एक साथ। points स्क्रीन कोऑर्डिनेट इस्तेमाल करते हैं और एलिमेंट से मिलाकर नहीं जाँचे जाते। रोज़ के टैप, swipe, टाइपिंग और बटन के लिए उन्हीं के लिए बने टूल चुनें।
| रीड-ओनली | डिस्ट्रक्टिव | आइडेम्पोटेंट |
|---|---|---|
| नहीं | नहीं | नहीं |
इवेंट
event एक object है जिसमें एक type और उस type के फ़ील्ड होते हैं:
type |
फ़ील्ड | यह क्या करता है |
|---|---|---|
touch1-down, touch1-move, touch1-up, touch1-cancel |
x, y; edge (वैकल्पिक) |
एक उँगली: रखना, हिलाना, उठाना, या cancel करना। edge (जैसे left, bottom) इसे स्क्रीन के उस किनारे से अंदर की ओर swipe बना देता है |
touch2-down, touch2-move, touch2-up, touch2-cancel |
x1, y1, x2, y2 |
एक साथ दो उँगलियाँ, pinch या दो उँगलियों से rotate के लिए |
tap |
x, y; duration (वैकल्पिक) |
एक टैप, जैसे कोऑर्डिनेट के साथ simulator_tap |
swipe |
startX, startY, endX, endY; duration (वैकल्पिक) |
जैसे simulator_swipe |
type |
text |
जैसे simulator_type_text |
key |
code; modifiers, duration (वैकल्पिक) |
जैसे simulator_key |
button |
button; duration (वैकल्पिक) |
जैसे simulator_button |
orientation |
orientation |
जैसे simulator_rotate |
fold |
degrees (0 से 180) |
foldable का hinge हिलाता है, जैसे simulator_fold |
हर pointer event (touch1-*, touch2-*, tap, swipe) वैकल्पिक width और height भी लेता है: डिवाइस की स्क्रीन के बजाय उस साइज़ के frame में कोऑर्डिनेट देने के लिए इन्हें भेजें, और वे फ़िट होने के लिए scale हो जाते हैं। कोई भी event display ले सकता है, यानी simulator_displays से मिला किसी display का screenId, ताकि foldable के किसी एक display को चुना जा सके।
इनपुट
| इनपुट | टाइप | ज़रूरी | डिफ़ॉल्ट | यह क्या करता है |
|---|---|---|---|---|
teamId |
string (UUID) | हाँ | — | टीम, list_teams से |
simulator |
string | नहीं | टीम का डिफ़ॉल्ट डिवाइस | कौन-सा डिवाइस, list_simulators से मिले id से |
event |
type वाला object |
हाँ | — | event |
नतीजा
| फ़ील्ड | मतलब |
|---|---|
ok |
true |
{ "ok": true }त्रुटियाँ
| संदेश | कब | क्या करें |
|---|---|---|
| event is an object with a “type”. | event मौजूद नहीं है, object नहीं है, या उसमें type नहीं है |
type वाला object भेजें |
| Failed to deserialize the JSON body into the target type: … | अज्ञात type, कोई फ़ील्ड गायब, या गलत type का फ़ील्ड |
संदेश में बताया गया फ़ील्ड ठीक करें |
साथ ही वे त्रुटियाँ जो हर Simulator टूल लौटा सकता है: देखें start_simulator।
उदाहरण
बाएँ किनारे से अंदर की ओर swipe (Back), तीन कॉल में:
{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-down", "x": 2, "y": 400, "edge": "left"}}}{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-move", "x": 200, "y": 400, "edge": "left"}}}{"name": "simulator_input", "arguments": {"teamId": "00000000-0000-0000-0000-000000000000", "event": {"type": "touch1-up", "x": 300, "y": 400, "edge": "left"}}}