Skip to main content

KmBoxNet

PyPI

高性能的 KmBoxNet (网络版) Python 绑定库,基于 Rust 开发。

High-performance Python bindings for KmBoxNet, written in Rust.

硬件请见官网:https://www.kmbox.top/

功能特性 (Features)

  • 🚀 高性能: 核心通讯逻辑由 Rust 实现,极低延迟。
  • 🖱️ 全功能控制: 支持鼠标移动、点击、滚轮,键盘按键控制。
  • 🔐 加密通信: 支持加密协议,防止数据包特征检测。
  • 👀 硬件监听: 支持监听物理键鼠的输入事件 (Monitor模式)。
  • 🖼️ LCD控制: 支持修改屏幕颜色、显示图片。
  • 🔧 硬件算法: 内置贝塞尔曲线等硬件级轨迹修正算法。

安装 (Installation)

使用 pip 安装:

pip install kmbox-net-rust

注意:在代码中导入时请使用 import kmbox_net。

快速开始 (Quick Start)

1. 连接设备与控制

import kmbox_net
import time

# 连接设备
# IP: 盒子显示的IP (例如 192.168.2.188)
# Port: 端口 (默认 8888)
# MAC: 盒子MAC地址 (例如 "0B50E466"),用于握手和加密
client = kmbox_net.KmBoxNetClient("192.168.2.188", 8888, "0B50E466")

# 鼠标相对移动 (X=100, Y=100)
client.mouse_move(100, 100)

# 鼠标左键点击
client.mouse_left(True)  # 按下
time.sleep(0.05)
client.mouse_left(False) # 松开

# 键盘输入 (按下 'A')
client.keydown(kmbox_net.KEY_A)
time.sleep(0.05)
client.keyup(kmbox_net.KEY_A)

2. 监听物理键鼠 (Monitor)

import kmbox_net
import time

# 定义回调函数
def on_event(mouse: kmbox_net.HardMouse, keyboard: kmbox_net.HardKeyboard):
    # 打印鼠标数据
    if mouse.buttons != 0 or mouse.x != 0 or mouse.y != 0:
        print(f"[Mouse] Btn:{mouse.buttons} X:{mouse.x} Y:{mouse.y}")
    
    # 打印键盘数据
    if keyboard.data:
        print(f"[Keyboard] Keys:{keyboard.data}")

# 1. 在本地端口 12345 开启监听线程
monitor = kmbox_net.KmBoxNetMonitor(12345, on_event)

# 2. 告诉盒子把数据推流到这个端口
# 注意:你需要先连接上盒子
client = kmbox_net.KmBoxNetClient("192.168.2.188", 8888, "0B50E466")
client.monitor(12345)

print("正在监听物理键鼠输入... 按 Ctrl+C 停止")
try:
    while True:
        time.sleep(1)
except KeyboardInterrupt:
    client.monitor(0) # 停止推流
    monitor.shutdown() # 停止本地监听

3. 加密功能 (Encryption)

import kmbox_net

# 使用加密通道移动鼠标 (防止抓包特征)
client.enc_mouse_move(100, 100)

# XXTEA 加密工具函数 (原地修改)
data = bytearray(128)
key = b"1234567890123456"
kmbox_net.xxtea_encrypt(data, key)

编译指南 (Building from source)

如果你需要自己编译项目,需要安装 Rust 工具链。

# 安装 maturin
pip install maturin

# 编译并安装到当前环境
maturin develop --release

License

MIT

Metadata

Release files for kmbox-net-rust 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kmbox-net-rust 1.0.2
File Size Uploaded Provenance Actions
kmbox_net_rust-1.0.2.tar.gz 657.6 kB With provenance Details for kmbox_net_rust-1.0.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kmbox-net-rust 1.0.2
File Actions
kmbox_net_rust-1.0.2-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for kmbox_net_rust-1.0.2-cp39-abi3-win_amd64.whl
kmbox_net_rust-1.0.2-cp39-abi3-win32.whl CPython 3.9 abi3 Windows x86-32 Details for kmbox_net_rust-1.0.2-cp39-abi3-win32.whl
kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.9 abi3 Linux glibc 2.17+ IBM System/390x Details for kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.9 abi3 Linux glibc 2.17+ PowerPC 64-le Details for kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-32 Details for kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.9 abi3 Linux glibc 2.17+ ARMv7l Details for kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
kmbox_net_rust-1.0.2-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for kmbox_net_rust-1.0.2-cp39-abi3-macosx_11_0_arm64.whl
kmbox_net_rust-1.0.2-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for kmbox_net_rust-1.0.2-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 4.1 MB

Release files / kmbox_net_rust-1.0.2.tar.gz

Download URL kmbox_net_rust-1.0.2.tar.gz
Size 657.6 kB
Tags Source
SHA-256 checksum
How to use checksums
05a158810dfbe27bd9d42e2507662021db3dec0e7de57e0e03e549932566a420
BLAKE2b-256 checksum
How to use checksums
65339883c9740638fae7adadec4aa6d80d7eb6b1832f6fb403017151b1a6b467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-win_amd64.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-win_amd64.whl
Size 212.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c31ddcee0b36026178c2bfbd38a6ff7cb6be556643c75a1461798e1d0503d1c2
BLAKE2b-256 checksum
How to use checksums
b3bb1a4d14c478a1aa258a9816560bc0d30086673d4b841959208a5142b4f527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-win32.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-win32.whl
Size 198.9 kB
Tags CPython 3.9 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
551a9c56986c5dad4432eccbd9a795c8b9ae2fc6d00e155b409bfa9295c2f99c
BLAKE2b-256 checksum
How to use checksums
cf46724afdb8d587a7fe106b5cf0ebf18fd5f9b51ee12d559d10a4a2b34b1a6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 367.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
3c0070231988f3580096cc1ee411697eef6b312fb289a396befc4e3b54f6e680
BLAKE2b-256 checksum
How to use checksums
6dfe2f5756324ea562f2fc1332de4fe7cdabb760791d36b8e1cc8f730b54895d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 398.1 kB
Tags CPython 3.9 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
750440697d601efd67bf2b7c0cab20a0e5c3a3b0d0910126838eafd29960f6d0
BLAKE2b-256 checksum
How to use checksums
cfa9ce204576656b320f10ce75e41fe6508f9b240c41c2a4058473b090f75976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 492.3 kB
Tags CPython 3.9 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
3fd480d2a313a318c9de4e112fc37c7a07296b7cc0f42b77e140effac3fe57c8
BLAKE2b-256 checksum
How to use checksums
f520bd346da2345c6d4e4cd8ddf66b8e69c31dcb4eee03bcdb1abd1a529f7dde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 391.8 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
7c1585d6a1a262a446bf8f18ce976e4ef39cf5c07446033e5074625b2007f379
BLAKE2b-256 checksum
How to use checksums
2a4ef5f6f49c9ed401f45e40c92343ea236f25db3c93a7970e8c4b11bb0a73e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 369.1 kB
Tags CPython 3.9 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
9274b9e937eff86d2ff8f41e993e3e2ca79627988eeeb0c5a9503cf87121c112
BLAKE2b-256 checksum
How to use checksums
00dbd213f948f7406f69888f66d1e478b8e6bd2f654350417094cae91c3fb0fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 368.2 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a3a19eb76def8d9dad51b586414535539b5896936fecef7045b7da735f2213ff
BLAKE2b-256 checksum
How to use checksums
8c5cff45fd275ed8bfa6075a34531e99f102ab00296cac9b949066e937ff61ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-macosx_11_0_arm64.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-macosx_11_0_arm64.whl
Size 327.5 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
17c795be82331271274f7fc5f416d336d38b09431de6f10fb139b05542a0825d
BLAKE2b-256 checksum
How to use checksums
0ccf37a0b16f87cecae757dc5c281818d0a962fb5aebdcc191fa5b509f0aa871
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / kmbox_net_rust-1.0.2-cp39-abi3-macosx_10_12_x86_64.whl

Download URL kmbox_net_rust-1.0.2-cp39-abi3-macosx_10_12_x86_64.whl
Size 328.2 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
85853be2f59ce57e7981ddbd6b509da82150fb22037ce6ef6a5dc915cc946382
BLAKE2b-256 checksum
How to use checksums
06d91cea561f17e6609326db26b1bd482c5096b5637ce8b2c6dd3a0a5d5e7f3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Security for kmbox-net-rust 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for kmbox_net_rust-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page