This app was mentioned in 3 comments, with an average of 1.33 upvotes
Easiest thing would be an application for the tablet that would convert touching a layout to keyboard commands that would then communicate to PC thru USB or WiFi. The other may be something like an Arduino with physical buttons you program for keyboard commands.
edit: maybe something like this, https://play.google.com/store/apps/details?id=name.pilgr.android.picat&hl=en
I have used this one before and it functions fairly well. Buttons are defined by an xml file and it doesn't really allow for any customization, but its low on resources and doesn't need an internet connection.
your comment inspired me to go looking for something for one of my old android tablets. I couldn't find anything gaming-centric, and only found this app https://play.google.com/store/apps/details?id=name.pilgr.android.picat Is there another tool you know about?