Guidance in using GPIO for keystrokes?

I’m using a Rock 4 SE with a touchscreen as a Chromium kiosk (Debian 11.6, works great) but where I’m stuck is in adding some physical buttons that send keypresses to Chromium.

Can someone please point me to the basic set of steps so that, for example, I can wire up a switch to my GPIO and have Chromium receive a typed letter “X” when the switch is closed? Something to do with libmraa?

Thank you!