Is there a hook for client key presses

Is there a hook for client key presses with the KEY_* enums, or do I have to use a Think hook with input.IsKeyDown()?

Maybe occsionally use wiki and CTRL+F?

Doesn’t that just support IN_ keys and not KEY_ keys?

I prefer http://wiki.garrysmod.com/page/GM/PlayerButtonDown. It’s what is used by the numpad library which in turn is used by shit like the TNT and Wheel stools.

It works both clientside and serverside.

Thanks for the info. I’ve been using PlayerBindPress this entire time for the F keys by matching the binds, but couldn’t use F8, F10, or F11 because there are no binds on them apparently. I wasn’t aware of PlayerButtonDown before, so this definitely helps. Cheers :dance:

PlayerButtonDown/Up and KeyDown/Up are very flaky.

As Mista says, PlayerBindPress is good.

Here’s why:
https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/open_vgui_based_on_keypress.lua.html

“Flaky”, how so?

I’ve switched to PlayerButtonDown and it’s reacting exactly the same as PlayerBindPress except I now have less limitations.

When holding a button down, and pressing others, not all buttons get registered.