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

Function sendHardwareButtonEvent

packages/client/src/app/AppShell.tsx:2591–2615  ·  view source on GitHub ↗
(
    button: string,
    phase: "down" | "up",
    usagePage?: number,
    usage?: number,
  )

Source from the content-addressed store, hash-verified

2589 }
2590
2591 function sendHardwareButtonEvent(
2592 button: string,
2593 phase: "down" | "up",
2594 usagePage?: number,
2595 usage?: number,
2596 ) {
2597 if (!selectedSimulator) {
2598 return;
2599 }
2600 if (phase === "down") {
2601 setAccessibilitySelectedId("");
2602 setAccessibilityHoveredId(null);
2603 }
2604 if (
2605 !sendControl(selectedSimulator.udid, {
2606 type: "button",
2607 button,
2608 phase,
2609 usagePage,
2610 usage,
2611 })
2612 ) {
2613 setLocalError("Simulator control stream disconnected.");
2614 }
2615 }
2616
2617 function sendCrownRotation(delta: number) {
2618 if (!selectedSimulator || !Number.isFinite(delta) || delta === 0) {

Callers

nothing calls this directly

Calls 1

sendControlFunction · 0.85

Tested by

no test coverage detected