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, there is no defined behavior of which key will be returned.

Arguments

1 string binding
The binding name
2 boolean exact = false
True if the binding should match exactly

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