Skip to main content

手机键盘控制电脑 - 通过手机浏览器控制电脑输入

Project description

手机键盘控制电脑

通过手机浏览器访问网页,使用虚拟键盘控制电脑输入。

原理:网页发送键盘按键到电脑,由电脑上的输入法(如搜狗、微软拼音)处理拼音转换。

快速安装

方法一:pip 安装(推荐)

# 安装
pip install screen-keyboard

# 运行
screen-keyboard

方法二:源码安装

# 克隆或直接下载后
pip install -e .

# 运行
screen-keyboard
# 或
python app.py

方法三:一行命令安装

curl -sL https://raw.githubusercontent.com/your-username/screen-keyboard/main/install-one-line.sh | bash

使用方法

1. 启动服务

screen-keyboard
# 或
python app.py

服务端启动后会显示局域网地址,例如:

局域网地址:http://192.168.1.100:5000

2. 手机访问

在手机上连接同一 WiFi,用浏览器访问该地址即可。

功能

  • ✅ 全键盘布局(QWERTY)
  • ✅ 符号/数字键盘切换
  • ✅ Shift 大写切换
  • ✅ 特殊按键(回车、退格、空格)
  • ✅ 方向键(倒 T 布局)
  • ✅ 触控板鼠标控制
  • ✅ 摇杆鼠标控制
  • ✅ 鼠标左右中键 + 滚轮
  • ✅ Win+Space 中英文切换
  • ✅ 拖动窗口/文件(双击触控板后拖动)
  • ✅ 锁定页面防止误触

说明

  • 确保手机和电脑在同一局域网
  • 电脑需开启拼音输入法
  • 如果防火墙阻止,请开放 5000 端口

开发

# 创建 conda 环境
conda env create -f environment.yml
conda activate screen-keyboard

# 安装依赖
pip install -r requirements.txt

# 运行
python app.py

发布到 PyPI

# 安装构建和发布工具
pip install build twine

# 构建包
python -m build

# 上传到 PyPI
python -m twine upload dist/*

# 或使用发布脚本
chmod +x publish.sh
./publish.sh

首次发布需要配置 PyPI API Token:

# 创建 ~/.pypirc 文件
cat > ~/.pypirc << EOF
[distutils]
index-servers =
    pypi

[pypi]
username = __token__
password = pypi-xxxxx  # 从 https://pypi.org/manage/account/token/ 获取
EOF

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

screen_keyboard-1.0.2.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

screen_keyboard-1.0.2-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file screen_keyboard-1.0.2.tar.gz.

File metadata

  • Download URL: screen_keyboard-1.0.2.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for screen_keyboard-1.0.2.tar.gz
Algorithm Hash digest
SHA256 8fc96dff6bd0a2b962bed25e2b0a45a2c9d5f7c7e294e23e4364979377b2d270
MD5 6cd32733c8eac6afdbd17633f1817ce0
BLAKE2b-256 0308213f6809c2f29064cfa10d43332d1d99b9dc60dcf708d65580da54ee16d7

See more details on using hashes here.

File details

Details for the file screen_keyboard-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for screen_keyboard-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 425bd3a47abadec2fee5745e26dc3ebbb39232bcd1cef90c7988add1dd59598a
MD5 95fa20eaaffdec9521a2f0dc12aac025
BLAKE2b-256 6527c70c7338d05273f24730e832d4ec6fa133db994c3d4d6c2e8e4ffafb3d54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page