So, on screen keyboards seem to be particularly non perfect. The most popular seems to be matchbox-keyboard, but it looks pretty dated and doesn’t seem to have been updated in a long time. We had a go using matchbox with our application but ended up dumping it because it wouldn’t sit on top our our full screen application and also looked too basic.
First update all packages
sudo apt update
sudo apt upgrade
Install matchbox-keyboard
sudo apt install matchbox-keyboard
Customising Layout
You can customise which keys are shown by creating your own xml file. The default layouts are located at: /usr/share/matchbox-keyboard
https://www.raspberrypi.org/forums/viewtopic.php?t=122020
Showing From C Code
popen("matchbox-keyboard", "r");
Issue with this was that our application uses gtk_window_fullscreen(), which means the keyboard is shown behind it. There is a way to have matchbox-keyboard appear withing a gtk application but its non trivial and we decided it just didn’t look good enough as a keyboard anyway for our needs.