I am looking for a way to simulate mouse and keyboard input in C++. I am looking for a cross-platform library that will help me achieve this. Any suggestions?
Target platforms are desktop platforms... Linux, Mac, and Windows only.
No, input device simulation is extremely platform specific, and finicky even on a single platform. It is not a robust technique for any purpose, so you will not find good libraries to implement it.
The part which is most difficult, once you have the fundamental APIs, is making the devices look realistic to the OS. You want gradual mouse movement updates to be sent at a moderately high frequency, like a mouse would do, and reasonable delays between clicks and keypresses. Executing a timeline of events and doing the basic geometry would probably be assisted by a game library like SDL.
If you ignore timing, the OS may decimate mouse motion, debounce buttons, rearrange the order of motion and clicks, ignore keypresses while the trackpad is in use, etc. I wrote just such a tool almost 10 years ago.