How would one go about controlling retrieving/setting the position of the mouse and triggier keyboard events on the operating system/X11 level? This is similar to functionality
There are lots of ways to tackle this.
The project that appears closest to what you describe is "ui"
The next level up would be to use one of the go bindings that calls SDL, which might be easier.
Higher up the stack would be a toolkit like GTK, QT, FLTK, (or even X11 as BurntSushi5 mentioned, but I wouldn't recommend it.) Just search github for the toolkit and select by language.