Assigning spacebar to mouse-left-click is probably a bad idea since you won't be able to type spaces in text. As a general note about macros, you could use Altium's macro language, but a simpler way is use a macro program such as AutoHotKey (AHK). You can set up AHK where specific macro sets are only executed for the currently active program. If the current active program isn't identified in the script, AHK will pass along the keyboard commands unaltered. Since Altium is such a poky program, some commands need long delays, somewhere between 50ms to 100ms. Mouse clicks may need 100ms.
This sample script for Altium and LTspice, which resides in a single text file, should be enough to get you going quickly.
; key modifiers !=alt ^=ctrl +=shift
#IfWinActive, Altium Designer
F1:: ; Wire Mode
F7:: ; PCB, toggle ref designation visibility
F10:: ; Pan to center
F10:: ; FFT
Click, 344, 105