#include <HotKey.au3>
For $i = 1 To 5
_HotKeyAssign ("0x3"&$i, '_rns', $HK_FLAG_EXTENDEDCALL)
Next
HotKeySet('{Esc}', '_Exit')
While 1
Sleep(20)
WEnd
Func _rns($ikey)
MsgBox(64, "Selection done", "№" & $iKey & " was selected")
EndFunc
Func _Exit()
Exit
EndFunc