32

I have an iPad 2 and would like that my Ubuntu system appear as a bluetooth keyboard for it, so that what I type on my computer appears on my iPad.

Is there a specific way to do that?

user16538
  • 149
Farid
  • 708
  • 1
    You would have to jailbreak your iPad to do that... Did you check out btstack and btstack keyboards? http://keyboard.ringwald.ch/Welcome.html

    I think this question has more to do with iPad rather than Ubuntu, unless you've already jailbroken your iPad.

    – Bharadwaj Srigiriraju Dec 26 '12 at 08:45
  • You could try an Arduino with a bluetooth shield but that is not really an Ubuntu Question. – David Dec 27 '12 at 21:19
  • @EliahKagan: Yeah, I've said "unless you've already jailbroken your iPad" to mean the same. ;)

    I've never used it, but I guess one might have to use software like Synergy at some point of time to make computer appear as keyboard over a network. Don't you think so?

    – Bharadwaj Srigiriraju Dec 28 '12 at 08:09
  • 1
    @ForbiddenOverseer It looks like we were wrong to think it would be necessary to jailbreak the iPad. (1) I know someone with a non-jailbroken iPad that accepts Bluetooth keyboards. (2) It's just the iPhone that has to be jailbroken to accept Bluetooth input. As it says on the site you linked to: "BTstack Keyboard runs on jailbroken iPhones, all iPod touch devices with Bluetooth support, and the iPad." Since that works, this Ubuntu method should too. – Eliah Kagan Dec 29 '12 at 02:22
  • @EliahKagan: Oh... I assumed the jail breaking was meant for all of them when I read that it's available on Cydia. Great answer BTW... One more reason to love linux... :) – Bharadwaj Srigiriraju Dec 29 '12 at 05:28
  • 1
    I do not think jailbreaking my iPad would really be useful for that. It's just that Ubuntu has to appear correctly. – Farid Dec 29 '12 at 14:24

1 Answers1

37

You can make your computer act as a Bluetooth keyboard for other devices, provided that:

  • It has Bluetooth, and runs Bluez. (This is true of Ubuntu systems with Bluetooth.)
  • It's running a Linux-based operating system. (That includes Ubuntu!)
  • You have administrative abilities in your Linux-based OS (for example, you can sudo to root).

There is a FOSS program that does this, called hidclient:

The hidclient program makes a Bluetooth® technology equipped computer appear as a Bluetooth® keyboard and mouse device to other machines. Input events (like keystrokes and mouse movements) of the locally attached input devices will be forwarded to another machine via the Bluetooth® link.

For the counterpart (which might be a Linux PC, a Win PC, a PDA...) there is no technical difference to "real" Bluetooth® input devices.

Source: hidclient's official site (main page).

That totally rocks: you don't have to do anything special to your iPad (or any other mobile device that works with Bluetooth keyboards) to get this to work. You don't have to jailbreak it. You don't have to install any special apps. Just install and run hidclient, then tell your mobile device (the iPad) you want to use your Bluetooth keyboard!

Everything you need to get the software and learn how to use it is right here.
After reading the whole page (so you understand how it works), make sure to use the instructions at the end (for Ubuntu).

Here's a compact version (essentially the same procedure – this worked better for me):

  1. Install libbluetooth-dev Install libbluetooth-dev.
  2. Download hidclient source code for Ubuntu. (Check the official page to make sure that's not out of date.) Put it in a folder by itself and extract its contents.
  3. Type make and press Enter to compile the source.
  4. Back up and edit your Bluetooth configuration:
    sudo cp /etc/bluetooth/main.conf /etc/bluetooth/main.conf.old
    sudo -H gedit /etc/bluetooth/main.conf
    • Under #DisablePlugins = network,input add the line DisablePlugins = input (no #).
    • Add a # to the beginning of Class = 0x000100; under it, write Class=0x000540 (no #).
    • Save the file and quit the text editor.
  5. If you want to be able to run hidclient like a normal command:
    • Run sudo cp hidclient /usr/local/bin.
    • Check if /usr/local/bin is in your path with echo $PATH.
    • If it's not, add it with any of these methods.
    If you skip this step, you can run hidclient by making sure you're in the directory where you compiled it, and running ./hidclient instead of hidclient.

Running hidclient

Run hidclient --help (or see the bottom of the web page) to see how to use it.

Except when run with the --help flag, hidclient must be run as root. So use sudo hidclient (followed by whatever options you're specifying, as explained in the help).

Basically, there's two steps:

  1. Run sudo hidclient -l for a numbered list of devices.
  2. Run sudo hidclient -eN -x, replacing N with the number of the device you want to "forward" over Bluetooth. In your case, this will be the keyboard.

You're all set. Tell your mobile device (iPad) to use a Bluetooth keyboard.

Terminating hidclient

The last thing you need to be able to do is to stop using the keyboard for Bluetooth input. See, when hidclient is running, the device you select is no longer giving input to your Ubuntu system. If it were anything but the keyboard (say, the mouse), you could quit hidclient by pressing Ctrl+C in the Terminal.

But you cannot do that, because keyboard input won't go to the Terminal or any other Ubuntu program. The keyboard is acting as a Bluetooth device!

So, when "forwarding" the keyboard, quit hidclient by closing the Terminal window (or tab) in which it's running, with the mouse (or trackpad).

  • Of course, if your Ubuntu machine has multiple keyboards, you could "forward" one as a Bluetooth device and continue to use the other on your computer.

References/Acknowledgements

Eliah Kagan
  • 117,780