📜 ⬆️ ⬇️

Use your laptop as a bluetooth keyboard (or mouse)

I just had a thought that I could connect a laptop via Bluetooth to a phone / tablet / etc, so that text could be typed on a computer and keystrokes could be transmitted to a mobile device.

It turns out that this is already implemented as a ready-made program, which turned out to be quite fast to google on request linux emulate bluetooth mouse .

It is called hidclient . Works on Linux-based computers with Bluetooth.
')
Theoretically, it is possible to transmit events from the keyboard or mouse to any device that supports connecting HID devices via Bluetooth. In practice, I tried it with an iPod - it works great.

So, suppose you have Ubuntu. You will need the header files:

apt-get install libbluetooth-dev 

Next, download the source code . Everything is simple: you need to unpack the tarball, go to the directory where you unpacked it, and execute make .

Make changes to /etc/bluetooth/main.conf:


Launch hidclient and connect to your mobile device. This is convenient to do through Bluetooth Manager (blueman-manager).

By the way, if you have multiple HID devices, you can choose which one you would like to use. That is, you can have, for example, two keyboards connected at once - with one event only the computer (X-server) will be used, and with the other only the mobile device.

I managed to gather information very quickly thanks to Eliah Kagan ( How do I make it a bluetooth keyboard? ) And Capt.Nemo ( Setup a bluetooth keyboard / mouse ).

I wish you all a good time in the console, and have a good weekend!

Source: https://habr.com/ru/post/363297/


All Articles