i've been wanting to do something like it
there is this tmk firmware
https://github.com/tmk/tmk_keyboard
that is used in the brownfox diy keyboard
https://deskthority.net/viewtopic.php?t=6050
but to simpify what looks complicated
there are a bunch of usb hid scan codes we'd need to return
https://gist.github.com/MightyPork/6da2 ... 55fdc73db2
so that makes it simplier
my guess is if we don't need the pins for other purpose, we can wire up a keyboard grid
https://en.wikipedia.org/wiki/ISO/IEC_9 ... IEC_9995-1
and basically use the pins for scanning
then return the relevant usb hid scan codes
and that makes it a keyboard
i think there are also some templates for usb hid keyboard 'report types' that is needed for the hid setup in the hid-1.1 specs
https://www.usb.org/document-library/de ... on-hid-111
to save on pins, we could use shift registers, but it may be more of a hassle unless you want to use the pins for something else
e.g. leds, it seemed quite possible to use things like neopixels for the leds and we'd have multi color leds.
but timing and all can be tight
macros is easy once we get the basic keyboard working, it is probably like writing some short cut keys into flash
there are tricky parts as well which is when multi keys are pressed e.g. the alt-ctrl.shift keys along with another key