Yeah man, they are called Binds and the way you do them is with the bind command. For example if you want your F1 key to say "Hi Rippie", then in the console you would type...
/bind F1 say Hi Rippie
Then when you press the F1 key it says Hi Rippie, hope that helps you out