Send keystroke event to system?

Is there any way to programmatically simulate a keystroke event to the computer? To be specific, I am not looking for a way for my program to simulate receiving an input, but rather send a keydown event (e.g. Alt+F9) to the machine’s keyboard stream. This event could then be picked up by any other programs running in the background that are listening for keyboard events. I would like to use something similar to SendInput() in Windows, but unfortunately this needs to work on linux also, so I’m hoping there’s way to do so from the UE4 libraries.

For context, I am attempting to automatically trigger screen recording in OBS whenever a demo recording starts and stops. Star/stop in OBS has been bound to some hotkeys, I want to add a couple of lines to my override of GameInstance::StartRecordingReplay() and GameInstance::StopRecordingReplay() to send those keystrokes to start and stop the screen recording.