With the recent update (20th of july) valve added support for custom keybindings. That is, you can bind key's to fire a custom command.
The technique used is derived from rpg_example.
Although this method is not nescessarily limited to panorama this tutorial will focus on using them within panorama.
Start by adding a couple of lines to your
addoninfo.txt file located in
The important parts are of course what is defined in
is the key you want to bind, use capital letters here
is the command to fire, make sure the command name is unique.
The prefix of the command defines when the command will trigger.
Name of the command, used for debugging purposes.
|(nothing)||command||Command will trigger on press and release|
|+||+command||Trigger when key is pressed (used for normal key press)|
|-||-command||Command will trigger when key is released|
The prefixes do not lock the command to be triggered only in that event. But is a good self-reference for what you want the keybind to do.
Catching the keybind commands in Panorama is easy:
Note how the prefixes are used again. Even though we only defined
CustomGameTestButton to be fired on key down, we can easily catch the release event in our JS aswell.