Getting Key Configuration

Is there a way to get the client’s key configuration? I want messages to be accurate, so when Walk( by default binded to ALT ) is another key( for example SHIFT) my messages will say: “Press SHIFT to explode”.

I’m now doing “Press WALK to explode”, which I don’t like.

This is how zinger did it.

[lua] // bind mapping table
local BindMap = {};

// read client configuration file
local config = file.Read( "../cfg/config.cfg" );

// interate through each line
for line in config:gmatch( "[^

]+" ) do

	// narrow down to only bind entries
	if ( line:sub( 1, 5 ) == "bind " ) then
	
		// extract key and bind
		local key, bind = string.match( line, "\"(.-)\" \"(.-)\"" );
		BindMap[ bind ] = key;
		
	end

end


/*------------------------------------
	GetKeyForBind()
------------------------------------*/
function util.GetKeyForBind( bind )

	// find key
	return ( BindMap[ bind ] == nil ) && "UNBOUND" || BindMap[ bind ];

end[/lua]

Beautiful. Thank you very much for this!

return ( BindMap[ bind ] == nil ) && “UNBOUND” || BindMap[ bind ];

what the shit

return BindMap[ bind ] or “UNBOUND”

Someone’s too used to ()?:; :v: