Tested on Banana Pi BPI-M2 ZERO running the 2022-09-07 Armbian jammy_edge_5.19.6_xfce_desktop image from the official wiki page.
- Start with a clean install of Raspberry Pi OS or Ubuntu with internet/wifi configured.
- SSH into the pi and run the following:
curl -sSL https://raw.githubusercontent.com/alxvngn/pi-as-keyboard/master/install.sh | sudo bash -
- Once the installation is finished, shutdown the pi, remove its power supply and use a regular microUSB to USB cable (non-OTG) to plug it into the USB connector marked USB on the board (the one next to the HDMI connector). Plug other end to a computer/mac.
The computer/mac will recognize the pi as a generic HID USB Keyboard. Open a text editor on the target computer/mac and test it.
Use another computer and ssh into the pi then run:
echo 'left-shift h' | ~/pi-as-keyboard/keeb /dev/hidg0 keyboard
echo 'i' | ~/pi-as-keyboard/keeb /dev/hidg0 keyboard
Or conveniently:
~/pi-as-keyboard/sendkeys left-shift h
~/pi-as-keyboard/sendkeys i
Success! Should see Hi in notepad Take a look at https://github.com/alxvngn/pi-as-keyboard/blob/master/keeb.c#L20 for available keys.