Garry's Mod Wiki

Revision Difference

DBinder#514202

<panel>⤶ <parent>DButton</parent>⤶ <preview>DBinder.jpg</preview>⤶ <description>Input which can bind a command to a key. Used for binding inputs and outputs of TOOLs.</description>⤶ ⤶ </panel>⤶ ⤶ ⤶ <example>⤶ <description>Creates a DBinder that prints to the player's chat when a new key is bound.</description>⤶ <code>⤶ local frame = vgui.Create("DFrame")⤶ frame:SetSize(250,100)⤶ frame:Center()⤶ frame:SetTitle("DBinder Example")⤶ frame:MakePopup()⤶ ⤶ local binder = vgui.Create( "DBinder", frame )⤶ binder:SetSize( 200, 50 )⤶ binder:SetPos( 25, 35 )⤶ ⤶ function binder:OnChange( num )⤶ LocalPlayer():ChatPrint("New bound key: "..input.GetKeyName( num ))⤶ end⤶ </code>⤶ <output></output>⤶ ⤶ </example>⤶ ⤶