Alright.
I am not sure about this but if you create a virtual keyboard or mouse driver, you might be able to use it to macro everything most likely. I don't know how software like Razer Synapse works, but if you got a razer keyboard, mouse I will assure you Razer Synapse allows you to record macros and you can use it in almost every game, if not all games.
Either way I don't know if some1 already used or test this, maybe it's undetectable and works o_o
EDIT - I just tested it it works but X-TRAP blocks click interactions.. (didn't checked if it detects keyboard input, but goodluck!)
Regards