Hi, Imagine I had my vgui binded to the key T this way :
[CODE]hook.Add("Think" , "detectkey" , function()
if not CLIENT then return end
if (input.IsKeyDown( KEY_T ) then openmenu() end
end)[/CODE]
When the LocalPlayer() is writting on the chat and he presses T, the menu opens, how can I avoid that?
Thank you :)
You might find the PlayerButtonDown or PlayerButtonUp hooks work better for what you want
[QUOTE=Willox;49720290]You might find the PlayerButtonDown or PlayerButtonUp hooks work better for what you want[/QUOTE]
That works better! :D But there's still one problem : The menu does not open when the player is walking (pressing W) its like it does not dettect when you press two keys at the same time maybe?
could using this work at all? [url]http://wiki.garrysmod.com/page/vgui/GetKeyboardFocus[/url]
im not sure if it works with the chatbox though (honestly have just throwing the idea out there)
you could possibly check if the panel it returns is nil if so then open the menu?