Map keys to touchscreen
If you are willing to use a PC as the interface.

There appears to exist a modified version of the open-source scrcpy which has keyboard shortcut support for playing games, but should partially map to your requirement:

QtScrcpy - gitee repo or QtScrcpy - github repo

See project README for keyboard mapping feature:
https://github.com/barry-ran/QtScrcpy/blob/master/README.md



It looks promising. Unfortunately I haven't used it, and while open source, most of the project UI/documentation isn't in English.

The issue thread for the keyboard mapping feature for scrcpy:

https://github.com/Genymobile/scrcpy/issues/712

you might want to look there for more options.