Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yskszk63/btknmle
Turn your keyboard and mouse connected to your computer into a bluetooth hid device.
https://github.com/yskszk63/btknmle
async-await ble hid hogp linux rust tokio
Last synced: 6 days ago
JSON representation
Turn your keyboard and mouse connected to your computer into a bluetooth hid device.
- Host: GitHub
- URL: https://github.com/yskszk63/btknmle
- Owner: yskszk63
- License: mit
- Created: 2019-11-04T13:56:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-08T13:14:31.000Z (about 2 years ago)
- Last Synced: 2023-08-14T04:21:06.421Z (over 1 year ago)
- Topics: async-await, ble, hid, hogp, linux, rust, tokio
- Language: Rust
- Homepage:
- Size: 2.58 MB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
BTKNMLE (BlueTooth Keyboard aNd Mouse Low Energy)
=================================================[![build](https://github.com/yskszk63/btknmle/workflows/build/badge.svg)](https://github.com/yskszk63/btknmle/actions)
[![codecov](https://codecov.io/gh/yskszk63/btknmle/branch/master/graph/badge.svg)](https://codecov.io/gh/yskszk63/btknmle)
[![dependency status](https://deps.rs/repo/github/yskszk63/btknmle/status.svg)](https://deps.rs/repo/github/yskszk63/btknmle)Turn your keyboard and mouse connected to your computer into a bluetooth hid device.
WIP
![logo](assets/logo.png)
DEMO (Linux PC vs Pixel3)
-------------------------![demo](assets/demo.png)
Runtime Requirements
--------------------- Linux 5.8+
- libinput(Sorry. Only linux is supported.)
Build Requirements
------------------Rust 1.51+
Prerequisite
------------Stop bluez if running.
```
sudo systemctl stop bluetooth.service
```Run
---via [Docker](https://github.com/yskszk63/btknmle/pkgs/container/btknmle)
```bash
docker run --rm \
--mount type=volume,source=btknmle,target=/var/lib/btknmle \
--device /dev/input --mount type=bind,source=/run/udev,target=/run/udev,readonly \
--mount type=bind,source=/sys/class/bluetooth,target=/sys/class/bluetooth,readonly \
--net host --cap-add net_admin \
ghcr.io/yskszk63/btknmle:latest
```With key grab.
```bash
docker run --rm \
--mount type=volume,source=btknmle,target=/var/lib/btknmle \
--device /dev/input --mount type=bind,source=/run/udev,target=/run/udev,readonly \
--mount type=bind,source=/sys/class/bluetooth,target=/sys/class/bluetooth,readonly \
--net host --cap-add net_admin \
-eBTKNMLE_GRAB=yes \
ghcr.io/yskszk63/btknmle:latest
```or
[Download form Nightly Release Page](https://github.com/yskszk63/btknmle/releases/tag/nightly)
- pre build binary
- deb packagearch: amd64 / arm / armv7 / arm64
usage
```
btknmleUSAGE:
btknmle [FLAGS] [OPTIONS]FLAGS:
-h, --help Prints help information
-v, --verbosity
-V, --version Prints version informationOPTIONS:
-D, --debug [env: BTKNMLE_DEBUG=]
-d, --device-id [env: BTKNMLE_DEVID=] [default: 0]
--grab [env: BTKNMLE_GRAB=]
-T, --trace [env: BTKNMLE_TRACE=]
-f, --var-file [env: BTKNMLE_VAR_FILE=] [default: /var/lib/btknmle/db.toml]
```Using
-----1. Start btknmle [Device]
2. Press any key to start Advertise [Device]
3. Scan bluetooth devices [Host]
4. Connect to btknmle named `btknmle` [Host]
5. Passkey input if required [Device]
6. ConnectedBuild
-----ArchLinux
```bash
sudo pacman -S libinput
git clone https://github.com/yskszk63/btknmle
cd btknmle
cargo build --release
```Tested device
-------------Currently ThinkPad A285 (ArchLinux) as device and Pixel3 as host only.
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
## Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.