I've written a small utility called Remote Input Server Daemon that creates a TCP server and accepts commands to emulate keystrokes (using Linux uinput). For now it only accepts specific keyboard commands but I intended to add mouse and other support.
It's similar to and inspired by MiSTer Batch Control. However, it's implementation of streaming keyboard commands creates and destroys the uinput device every time a new command or macro is sent. Instead, this utility creates an input device at startup and remains running listening to commands. (and has a few other features like multiple connection support, etc)
The intended purpose is to be used with a Control4 home automation (remote control) system and I've created a driver to be used as well. The end result is controlling your MiSTer (or HTPC such as SteamOS) without requiring any additional hardware.
I've included scripts for both init.d (MiSTer) and systemd.
Hopefully somebody finds it useful