MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / sendControl

Function sendControl

packages/client/src/app/AppShell.tsx:2254–2267  ·  view source on GitHub ↗
(udid: string, message: ControlMessage)

Source from the content-addressed store, hash-verified

2252 }, []);
2253
2254 function sendControl(udid: string, message: ControlMessage): boolean {
2255 if (isMoveControlMessage(message)) {
2256 pendingControlMoveRef.current = { message, udid };
2257 if (!controlMoveFrameRef.current) {
2258 controlMoveFrameRef.current = window.requestAnimationFrame(() => {
2259 controlMoveFrameRef.current = 0;
2260 flushPendingControlMove();
2261 });
2262 }
2263 return true;
2264 }
2265 flushPendingControlMove();
2266 return sendControlNow(udid, message);
2267 }
2268
2269 function sendTouchControl(udid: string, phase: TouchPhase, coords: Point) {
2270 sendControl(udid, { type: "touch", ...coords, phase });

Callers 6

AppShellFunction · 0.85
toggleSoftwareKeyboardFunction · 0.85
sendTouchControlFunction · 0.85
sendHardwareButtonEventFunction · 0.85
sendCrownRotationFunction · 0.85
rotateSelectedSimulatorFunction · 0.85

Calls 3

isMoveControlMessageFunction · 0.90
flushPendingControlMoveFunction · 0.85
sendControlNowFunction · 0.85

Tested by

no test coverage detected