Skip to content

Turn your keyboard and mouse connected to your computer into a bluetooth hid device.

License

Notifications You must be signed in to change notification settings

yskszk63/btknmle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTKNMLE (BlueTooth Keyboard aNd Mouse Low Energy)

build codecov dependency status

Turn your keyboard and mouse connected to your computer into a bluetooth hid device.

WIP

logo

DEMO (Linux PC vs Pixel3)

demo

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

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.

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

  • pre build binary
  • deb package

arch: amd64 / arm / armv7 / arm64

usage

btknmle

USAGE:
    btknmle [FLAGS] [OPTIONS]

FLAGS:
    -h, --help         Prints help information
    -v, --verbosity
    -V, --version      Prints version information

OPTIONS:
    -D, --debug <debug>            [env: BTKNMLE_DEBUG=]
    -d, --device-id <device-id>    [env: BTKNMLE_DEVID=] [default: 0]
        --grab <grab>              [env: BTKNMLE_GRAB=]
    -T, --trace <trace>            [env: BTKNMLE_TRACE=]
    -f, --var-file <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. Connected

Build

ArchLinux

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

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.

About

Turn your keyboard and mouse connected to your computer into a bluetooth hid device.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages