I was looking for this for some time, specifically for an option to hold down buttons for a set period of time, and found no satisfying solution. So I implemented it, Windows only for now.
I figured it might be useful to other people as well, so here's the repo: GitHub - MeLight/soft-keyboard: Software only keyboard emulator for Arduino.
And here's the blogpost: Live Fast - Code Young: Software only Arduino keyboard emulator
Will be glad to answer any questions