Ubuntu – How to share Keyboard and Mouse Via Bluetooth? (Like in windows Control)

bluetoothusb

*** Edited: (or rather, Added to)

Once upon a time…)


The Goal

After pairing A Host Windows machine to a…
1. -Another windows machine
2. -Android machine: Phone/tablet/etc…
I can use my Hosts Keyboard and mouse to control it.
I cannot do this in Ubuntu

(Better said, I do not know how and cannot find the right keyword to search for in synaptic)
Any help would be appreciated.

Meanwhile 6 years, 3 months later…

I have been looking for a way to emulate a native/standard (USB/PS2) Bluetooth HID Keyboard and mouse via a computer: Be it a linux Desktop/Laptop or Android Linux… Linux.

The end-goal simply is to connect to a bluetooth Keyboard and mouse HID compatible device… from a linux based operating system.

Even if it means…

  • learning some obscure software, that i am as yet unaware of.
  • connecting using a second Keyboard and mouse
  • buying a special USB, PCIe (or even pci) or other extra component.
  • buying a certain kind of computer, PDA, Phone, single board, etc…
  • or if all else fails buying a special standalone device, which is recognized as a standard bluetooth HID…to achieve this.

Can anyone hint me in a direction?

Best Answer

Clone this Github repository: https://github.com/kcolford/hidclient

git clone https://github.com/kcolford/hidclient

Edit the hidclient.c and comment out #include <stropts.h> (line number 105)

Build it

gcc -o hidclient -O2 -lbluetooth -Wall hidclient.c

List all input devices:

sudo ./hidclient -l

The output would look similar to this:

[severus@tux hidclient]$ sudo ./hidclient -l
List of available input devices:
num Vendor/Product, Name, -x compatible (x/-)
 0  [0000:0005.0000] 'Lid Switch' (-)
 1  [0000:0001.0000] 'Power Button' (+)
 2  [0000:0001.0000] 'Power Button' (+)
 3  [0001:0001.ab41] 'AT Translated Set 2 keyboard' (+)
 4  [0000:0000.0000] 'HP Wireless hotkeys' (+)
 5  [001f:0001.0100] 'PC Speaker' (-)
 6  [0000:0000.0000] 'HDA Intel PCH Mic' (-)
 7  [0000:0000.0000] 'HDA Intel PCH Headphone' (-)
 8  [0000:0006.0000] 'Video Bus' (+)
 9  [0000:0006.0000] 'Video Bus' (+)
10  [0000:0000.0000] 'HP WMI hotkeys' (+)
11  [0000:0000.0000] 'HDA Intel HDMI HDMI/DP,pcm=3' (-)
12  [0000:0000.0000] 'HDA Intel HDMI HDMI/DP,pcm=7' (-)
13  [0000:0000.0000] 'HDA Intel HDMI HDMI/DP,pcm=8' (-)
14  [0000:0000.0000] 'HDA Intel HDMI HDMI/DP,pcm=9' (-)
15  [0000:0000.0000] 'HDA Intel HDMI HDMI/DP,pcm=10' (-)
[severus@tux hidclient]$ 

If you want to expose keyboard (say) bluetooth,

sudo ./hidclient -e3 -x

-x to disable it on host.

Note: If you get error related to SDP server, you might want to enable compat to support some of the depreciated functions. For that, refer: https://askubuntu.com/a/814969/497359

Related Question