Bluetooth BLE Events
Overview
- Inject touch and key events via PC ↔ ESP32 Bluetooth HID board ↔ phone (phone acts as HID Host)
- Script object prefix is
bleEvent, e.g.bleEvent.clickPoint(100, 200) - Before use, bind UDID ↔ bleMac in control center via right-click "Bluetooth HID Settings"; phone must be paired with the board
- For HarmonyOS Next USB control center 3.2.0+
- Setup and firmware flashing: Bluetooth BLE Tutorial
- Different from USB HID Events (
hidEvent): USB HID uses cable/AOA; this module uses a Bluetooth board
tip
- Touch uses absolute pixel coordinates (same as Android BleCommander); call
setScreenSize(width, height)first - Communication:
setSendCmdType(1)serial (default) /setSendCmdType(2)network (board must be on WiFi) - Return value:
nullor empty string = success; other strings = error message - For long Chinese text, use proxy input (e.g.
inputText) instead of HID key codes