CircuitPython code to convert BBC Micro keyboard to HID controller. See code.py.
The mappings to the GPIOs (in my case for a pico are in the file). You'd probably have to change these depending on how you connected it if you wanted to make use of this code.
Code could be tidied, but it works for me, and that's all it needs to do.