VoiceAttack has a "Recorder" feature that can register keystrokes, mouse clicks, and mouse positions (the latter by pressing a key), and translate those to a set of actions within a command
However, this requires you to first start editing or creating a command, and opening the recorder.