Just so you could visualize my suggestion better, the buttons layout could be similar to this Showroom legend on the bottom of the page, the link to which you can find posted by @funny in this topic.
You would have to use the actual buttons to make it work.
Also, since you already have a code for when the keyboard buttons are pressed then maybe just reuse that code for buttons on the screen.