Garry's Mod Wiki

input.LookupBinding

  string input.LookupBinding( string binding, boolean exact = false )

Description

Returns the client's bound key for the specified console command. If the player has multiple keys bound to a single command, then the key with the lowest BUTTON_CODE enum will be returned.

Arguments

1 string binding
The binding name
2 boolean exact = false
True to disable automatic stripping of a single leading + character

Returns

1 string
The first key found with that binding or no value if no key with given binding was found.

See also input.GetKeyCode.

Example

Demonstrates usage of this function and its arguments.

print( input.LookupBinding( "+use" ) ) print( input.LookupBinding( "use" ) ) print( input.LookupBinding( "+use", true ) ) print( input.LookupBinding( "use", true ) )
Output:
e e e no value