I'm working on a program that i need to copy and paste while not in focus

I have the code to register global hotkeys (ctrl+1 ctrl+2 etc) but i want to trigger a copy or paste when the hotkey is triggered

I'm not sure what the best way is to send a keystroke to the os is

any ideas or hits?

Thanks so much