Discovered XTestFakeKeyEvent, which is X-only, but would be sufficient in my case because even though I do much of the development on Mac my application will be deployed on Linux. Will give it a try next week when I have access to my Linux box.
Have a nice weekend everyone!
Joerg