The microbit has an excellent bluetooth extension that will allow it to show up in applications as a keyboard.
The first step in getting it working is to add the extension through the makecode.microbit palette.
I add “keyboard’ to the search terms and I get the “pxt-blehid” extension.
I’ll build a simple example that sends the letters “a” and “b” to my computer as an example.
My finished code will look like this:
Next, I’ll load this to my MicroBit and test the connection. You can connect directly to the MicroBit or download and drag from the download folder to the Microbit, which is what I do to make sure I can visually confirm that the code is on the M:B.
Once I have the code on my MicroBit, I’ll connect to my Mac.
I open the “apple” icon and go to system settings. Then I select “bluetooth. I’ll make sure the bluetooth is “on” and then select the Microbit I have from the available bluetooth devices. Mine is called “zigup”. It connects automatically because my computer rcognizes it from previous pairing. you may need to select your device.
Once I have it paired, I open a simple text document and press “A” and “B” on the microbit. I should see the letters “a” and “b” typing on my document as I press the buttons.
Windows
Below, we’ll go through the steps of hooking up a Microbit as a Bluetooth keyboard in the Windows environment.
I go to the search bar and type in “bluetooth” and select “Bluetooth and other devices” from the menu.
My Microbit is loaded with this code