Hotkey vs mouse click

Is any way (using VBscript for example) to detect is function activated by mouse (button click) or by hotkey assigned to the same button?

clickData.func.fromkey

Works perfect, thank you.
Now, with that script for detecting processes, I can make exactly what I want.