Skip to content
Projects

About

Cross-platform smart mouse SDK with USB HID/BLE support and a C ABI for button events and audio. Downloads are available for Windows x64 and macOS ARM64; packages for other platforms are available on request.

Design & Media

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+130
in 15 days
+553
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.en.md

Original

uMouse SDK — USB HID / BLE Smart Mouse Integration

简体中文 | English

release ABI samples

SoniCloud Smart Mouse SDK (uMouse SDK) connects USB HID and BLE devices through a unified C ABI, providing device discovery, connection management, key events, JSON device information, and PCM audio for hardware vendors, application developers, and system integrators. Call it from C/C++, C#, Python, or Electron / Node.js.

Requires compatible SoniCloud hardware or your own hardware adapted through RAW mode; installing the SDK does not add these capabilities to an arbitrary mouse. This repository provides binary SDK packages, a public header, documentation, and MIT-licensed sample code. See the license scope for SDK binaries and proprietary protocols.

Downloads · Quick start · Compatibility & FAQ · Hardware & support

Downloads and Developer Resources

Resource Link
Windows 10 / 11 x64 · SDK 0.4.20 Download Windows ZIP
macOS 11+ ARM64 · SDK 0.4.20 Download Apple Silicon ZIP
Release notes and all releases GitHub Releases
Full integration documentation v2.2 English guide · 中文指南
C samples and public API Choose a sample · umouse_sdk.h
Linux / UOS / Kylin / FangDe packages, compatible hardware, and evaluation units Access and technical support

Quick Start

  1. Get the sample source code:

    git clone https://github.com/SonicloudTech/mouse-sdk.git
    cd mouse-sdk
    
  2. Download the ZIP matching your OS and architecture above. Extract it into the repository root and confirm that uMouseSdk/include/umouse_sdk.h and the SDK libraries are present. The same two platform packages are also available in packages/.

  3. Connect compatible hardware, then build and run the minimal sample from the repository root. On Windows, use an x64 MSVC developer command prompt; on macOS, install Xcode Command Line Tools.

Windows x64:

cl /I uMouseSdk\include demo\demo.c /Fe:umouse-demo.exe /link /LIBPATH:uMouseSdk uMouseSdk.lib
set "PATH=%CD%\uMouseSdk;%PATH%"
umouse-demo.exe

macOS ARM64:

cc -IuMouseSdk/include demo/demo.c -LuMouseSdk -luMouseSdk -Wl,-rpath,@executable_path/uMouseSdk -o umouse-demo
./umouse-demo

Keep the packaged runtime libraries alongside the main SDK library. See the package README for Windows DLL and VC runtime loading details. On macOS, allow Bluetooth access when first using BLE; the package includes its FFmpeg libraries, so no separate installation is needed.

The sample prints the SDK version, followed by [connected] when a device comes online, then device events and audio lengths. Received PCM is saved to out.pcm. Press Enter to exit. A version string confirms library loading; use device connection events and callback data to confirm the hardware connection.

Core sequence: register callbacks → um_sdk_init() → run your application → um_sdk_close(). The SDK supplies key events, device events, and audio; speech recognition and key-to-action mapping belong to your application. See the full integration guide for details and troubleshooting.

Choose a Sample

Use case Sample
SoniCloud device basics: keys, device information, and PCM audio demo.c — minimal FULL-mode integration
Raw frames from a SoniCloud device, parsed by your application demo2.c — RAW mode, handshake, and channel switching
SoniCloud devices and custom devices connected together demo3.c — multiple rules and devices, FULL / RAW coexistence
External hardware with custom identifiers, handshake, and parsing demo4.c — complete example replacing the default rule

demo4.c currently uses real SoniCloud identifiers and protocol messages to demonstrate the integration flow. For your own hardware, replace its HW_* configuration, handshake, and parsing logic. A custom USB hardware data channel must occupy the selected interface's first HID top-level collection or a dedicated interface, and support Output Report or Feature Report writes. See the sample guide (Chinese) for the complete prerequisites and sample selection; arbitrary USB / BLE hardware still requires adaptation.

Capabilities

  • Device discovery and connection: plug-and-play USB 2.4G receivers, BLE scanning and automatic takeover, USB-preferred channel selection, and runtime switching with stable device identity (SN) across channels.
  • Multiple devices: units of the same model can share a rule; configurable defaults are 4 devices per rule and 8 globally, with independent parsing per device.
  • Key events: speech / translation / M / AI / capture keys with down, up, hold, and click actions. Unsupported key types pass through as raw code values, without application-specific mapping.
  • JSON device events: SN, battery, meeting state, DPI broadcasts, meeting lifecycle and exclusive scheduling, plus pairing, device-count, and BLE-link-count warnings.
  • Audio: built-in SBC / ADPCM and other decoding to PCM (16 kHz / 16-bit / mono), or raw encoded blocks for application-side decoding.
  • RAW mode: custom handshake, device matching, SN extraction, and protocol parsing, with bidirectional transfer through um_write_raw.
  • Diagnostics: process crash records excluding application data, internal logging controls, and queue-health reporting.

Platforms and Architectures

OS Architecture USB BLE Distribution
Windows 10 / 11 x64 ✅ ✅ Public download
macOS 11+ ARM64 (Apple Silicon) ✅ ✅ Public download
UOS (UnionTech) x86_64 / ARM64 ✅ ✅ Contact us
Kylin x86_64 / ARM64 ✅ ✅ Contact us
FangDe x86_64 / ARM64 ✅ ✅ Contact us
Generic Linux x86_64 ✅ ✅ Contact us
macOS (Intel) x86_64 ✅ ✅ Contact us

The internal SDK source uses CMake to build for different operating systems and architectures, with a shared public C ABI and JSON event protocol. This repository distributes packages and integration resources, not the complete SDK source. Windows x64 and macOS ARM64 packages are publicly downloadable; contact us for the other combinations above. Binaries are built separately for each OS and architecture and are not interchangeable; Linux distributions also require matching packages.

Language Integration

Language Integration method
C / C++ Header and import library, MSVC / MinGW / clang / gcc
C# / .NET P/Invoke
Python Standard-library ctypes
Electron / Node.js FFI libraries such as koffi

Language snippets, callback lifetime rules, and API details are available in the English integration guide and Chinese integration guide. The standalone compilable samples in this repository are the four C programs above.

Use Cases and Related Project

  • Hardware input for voice typing, translation tools, and meeting-note applications.
  • Hardware vendors integrating their own device protocols through RAW mode.
  • System integrators deploying device connectivity on x86_64 / ARM64 UOS, Kylin, FangDe, and other Chinese domestic IT platforms.

For AI agents operating a physical mouse, see mouse-mcp (uMouse MCP server). It exposes mouse actions and voice-input integration through MCP and compatible uMouse USB hardware, currently on Windows x64. This SDK serves application and hardware integration; consult the MCP repository for its own platform and hardware requirements.

Repository Layout

├── README.md                    Chinese README
├── README.en.md                 English README
├── docs/第三方接入说明.md        Chinese integration guide v2.2
├── docs/Integration-Guide.en.md  English integration guide v2.2
├── include/umouse_sdk.h          Public C ABI header
├── demo/                        demo.c / demo2.c / demo3.c / demo4.c
├── packages/                    SDK 0.4.20: Windows x64 / macOS ARM64 ZIPs
├── img/                         Contact QR code
├── LICENSE                      MIT sample-code license
├── THIRD_PARTY_LICENSES.txt      Third-party notices
├── COPYING.LGPLv2.1             FFmpeg license text
└── LICENSE.hidapi-bsd            HIDAPI license text

Hardware, Other Platform Packages, and Support

Contact SoniCloud (安徽声云智能科技有限公司) for compatible hardware specifications, evaluation units, the full protocol, Linux / Chinese domestic OS and other architecture packages, commercial licensing, or technical support. Include your target OS and architecture, device model, expected volume, and use case.

SoniCloud technical and business contact WeChat QR code

License Scope and Third-Party Components

Sample code under demo/ is released under the MIT License. SDK binaries, proprietary device protocols, and some documents may contain proprietary content belonging to SoniCloud or its partners; the project is not open source as a whole. Commercial use is governed by the accompanying notices and the agreement between the parties. The SDK does not replace application-side speech recognition or business mapping. Do not use proprietary protocols for unauthorized hardware or products.

SDK binaries dynamically link FFmpeg (LGPL-2.1+, shipped as separate libraries that end users can replace) and statically embed HIDAPI (BSD-3-Clause). The macOS package uses a minimal FFmpeg build containing only the required audio decoders and no GPL components; its build configuration is in the package README. See the third-party notices, LGPL text, and HIDAPI license for attribution and use requirements.

USB HID / BLE SDK: frequently asked questions

Is this a universal driver for any USB or Bluetooth mouse?

No. FULL mode handles compatible SoniCloud devices. Your own hardware requires RAW-mode adaptation of device matching, handshake, and frame parsing. Start with the sample selection guide and demo4.c; having a USB or BLE connection alone is insufficient.

Can I use the SDK from Python, Electron, or C#?

Yes, through the public C ABI: Python uses ctypes, Electron / Node.js can use an FFI library such as koffi, and C# uses P/Invoke. Match the application's process architecture to the native package. Keep callback objects alive, copy callback buffers before returning if retaining them, and follow the lifecycle rules in the integration guide. The standalone samples in this repository are C programs, not packaged applications for every language.

Why does the library fail to load even when uMouseSdk.dll exists?

Check the process architecture, library search path, and all runtime dependencies in the downloaded package. Keep its FFmpeg and VC runtime DLLs with the SDK and follow the package README's loading instructions. Do not copy only the main DLL. On macOS, keep the bundled dylibs together and allow Bluetooth access when using BLE.

Where are the Linux and ARM64 downloads?

The current public v0.4.20 release contains Windows x64 and macOS ARM64 packages. Linux, UOS, Kylin, FangDe, and other combinations listed in the platform matrix are available through technical support. Request the exact OS and architecture; binaries are not interchangeable.

Does the SDK include speech recognition or an MCP server?

The SDK supplies device events and audio; your application implements speech recognition and business actions. For AI-agent hardware mouse control, use the separate mouse-mcp server, whose published packages target Windows x64 and require compatible hardware. SDK binary licensing is separate from the MIT sample-code license.

Reporting Issues

Open a GitHub issue with your target OS and architecture, device model, SDK version (um_sdk_version()), reproduction steps, and relevant logs enabled by um_sdk_init(1).

Explore related projects

Loading…