Keyboard actions through GPIO input? ( Android11)

Hello everyone,

like in Raspberry Pi, i want to simulate Keyboard inputs if an GPIO input is pressed in Android11.
In the Pi, you just have to modify the config txt.
I know that it is not that simple in the rockpi.
As far as i know GPIO control can be achieved via libmraa.

I was able to read the gpio inputs via adb connection and the command:

mraa-get 37

My next step and question is how to write a script which runs automically from start in the background and listens to certain gpio inputs. If the input is pressed, the keyboard event (A, page_down…m etc. should be pressed).

Am i right that it should be a shell script?