Examples of using functions with hotkeys:
Hotkey, a, MyFunction ; Calls MyFunction() when a is pressed
MyFunction() {
MsgBox You pressed %A_ThisHotkey%.
}
Or:
a::MyFunction()
MyFunction() {
MsgBox You pressed %A_ThisHotkey%.
}