Garry's Mod Wiki

ControlPanel:KeyBinder

  Panel ControlPanel:KeyBinder( string label1, string convar1, string label2 = nil, string convar2 = nil )

Description

Creates a CtrlNumPad (a Sandbox key binder) panel and adds it as an item.

Arguments

1 string label1
The label for the left key binder.
2 string convar1
The name of the convar that will store the key code for player selected key of the left key binder.
3 string label2 = nil
If set and convar2 is set, the label for the right key binder.
4 string convar2 = nil
If set and label2 is set, the name of the convar that will store the key code for player selected key of the right key binder.

Returns

1 Panel
The created CtrlNumPad panel.