Is there anyway to assign a shortcut key to a user-defined function?

 

Excuse me,

I met a problem and wish you experts could give me a hand.

I have made a user-defined function, and I want to assign a shortcut key, for example, alt + space to it.

Whenever I press alt+space, the function would be called.

Is it possible?

Thank you so much!

 
write the function in a script then set an hotkey for the script
 
qjol:
write the function in a script then set an hotkey for the script

gjol,

Could you please give me an example?

How to set a hotkey for a script?

Thank you so much!

 
qjol:
write the function in a script then set an hotkey for the script

I think I have found out the way to set hotkey.

Thank you so much!