3

I created a website that shows users a simple QWERTY keyboard, a mouse trackpad and two buttons that act as each mouse button.

Now what I want:

  1. User visits https://www.mykboard.com with Computer A.
  2. User clicks a button on the page to show available devices.
  3. User manually connects Computer A to Computer B that also has Bluetooth on.
  4. User opens on Computer B a simple text editor.
  5. User hits on the website on Computer A the key "h" to write the text in Computer B.

Would this be possible with the Bluetooth API ?

Carlos Pinto
  • 136
  • 7
  • 1
    No, because a website (opened in a browser) cannot send key commands or mouse clicks to the operating system. You need an actual executable program to remote control arbitrary applications. –  Dec 15 '21 at 10:17
  • 1
    Well, that is not correct AFAIK. I mean, a few days ago i installed the app "Bluetooth Keyboard and Mouse" onto my phone. There was no need to install a server program onto my PC as it worked via Bluetooth. So I asked myself how far tech these days is and found out about the Bluetooth Web API. With it you can send and receive Bluetooth data from a Bluetooth device. I am just wondering if it is possible to send keystrokes so that you could create a keyboard app with it. – Carlos Pinto Dec 15 '21 at 15:39
  • Sorry, I forgot to mention that said data and the API work right from within your browser. No need of any plugins or server tools. – Carlos Pinto Dec 15 '21 at 15:44
  • I see, according to MDN "The Web Bluetooth API provides the ability to connect and interact with Bluetooth Low Energy peripherals", so the question is whether the browser device itself can act as a peripheral. Doesn't sound like it but I don't know –  Dec 16 '21 at 09:07
  • 1
    I have the same question, did you find the answer, it just a matter using the right BLE profile. – Priyank Bolia May 01 '22 at 06:04

0 Answers0