Keyboard shortcuts inside macro

Does anybody know if it is possible to have keyboard shortcuts inside a macro?

Lets say you run a macro and when you press "a" it runs "Sub A" and when you press b it runs "Sub B" and if you press "x" the macro ends...

SolidworksApi macros