Is it possible to set a function to a key?
I don't mean keybinds; more like keybinds that are auto-binded and you can't change.
Yes, but clientside only.
movemap.bind("device","button","whenpressed","whenreleased");
i.e.
movemap.bind("keyboard","alt d","jump","jump");
(Makes Alt D function like your Jump key)
movemap.bindcmd("keyboard",";","canvas.pushDialog(AvatarGUI);","");
(BindCmd lets you execute code rather than just a function. Here, it makes ; function as a quick Avatar GUI shortcut)