Author Topic: Using a key  (Read 1053 times)

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.

Maybe look at Space Guys portal gun. The orange portal was auto binded to the right mouse button.

Wasnt auto binded.


The way most add-ons work to add keys is by overriding presets-- The portal uses the jet key, ect.


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)

I don't think you actually need the last argument if both the onClick and onRelease functions are the same.

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)
Thanks; clientside should be good enough.