# BluetoothMouse **Repository Path**: zonkin/bluetooth-mouse ## Basic Information - **Project Name**: BluetoothMouse - **Description**: 鸿蒙模拟鼠标 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-26 - **Last Updated**: 2026-01-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 蓝牙鼠标模拟器 这是一个基于鸿蒙系统的蓝牙鼠标模拟应用,可以将手机变成一个无线鼠标。 ## 功能特性 - **触摸板**:在触摸区域滑动手指来控制鼠标移动 - **鼠标按键**:支持左键、右键、中键点击 - **滚轮**:支持上下滚动功能 - **蓝牙连接**:使用 BLE HID 协议模拟鼠标设备 ## 使用方法 1. 打开应用 2. 点击"连接"按钮开始广播蓝牙信号 3. 在其他设备上搜索并连接到此蓝牙设备 4. 连接成功后,可以使用触摸板和按钮控制鼠标 ## 项目结构 ``` BluetoothMouse/ ├── entry/ │ ├── src/main/ │ │ ├── ets/ │ │ │ ├── entryability/ │ │ │ │ └── EntryAbility.ets │ │ │ ├── pages/ │ │ │ │ └── Index.ets │ │ │ └── services/ │ │ │ └── BluetoothManager.ets │ │ ├── resources/ │ │ │ └── base/ │ │ │ ├── element/ │ │ │ │ ├── color.json │ │ │ │ └── string.json │ │ │ ├── profile/ │ │ │ │ └── main_pages.json │ │ │ └── media/ │ │ └── module.json5 │ ├── build-profile.json5 │ ├── hvigorfile.ts │ └── oh-package.json5 ├── app.json5 ├── build-profile.json5 ├── hvigorfile.ts └── oh-package.json5 ``` ## 开发环境 - DevEco Studio 5.0+ - HarmonyOS SDK API 12+ - ArkTS ## 权限说明 应用需要以下权限: - `ohos.permission.USE_BLUETOOTH` - 使用蓝牙 - `ohos.permission.DISCOVER_BLUETOOTH` - 发现蓝牙设备 - `ohos.permission.ACCESS_BLUETOOTH` - 访问蓝牙 - `ohos.permission.LOCATION` - 位置权限(蓝牙扫描需要) ## 注意事项 1. 首次使用需要授予蓝牙和位置权限 2. 确保手机蓝牙已开启 3. 连接成功后状态会显示为"已连接" 4. 触摸板区域支持单指滑动控制鼠标移动 ## 技术实现 - 使用鸿蒙蓝牙 API 创建 GATT Server - 实现 HID (Human Interface Device) 协议 - 使用 ArkUI 构建现代化用户界面 - 支持触摸事件处理和手势识别