"input.IsKeyDown(95)" Not Registering...

I am making a gamemode and I’m trying to make a menu pop-up when I press F4, With this code:


if input.IsKeyDown(95) then


This is placed inside of cl_init.lua

It doesn’t print the “HAI” or run the console command … Any ideas?

95 is not a KEY_* enumeration http://wiki.garrysmod.com/?title=Binding_a_VGUI_to_F1-F4

Thanks, But I was thinking of using this in other places with other keys than just the F keys… D:

Then use the **[Gamemode.KeyPress

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.KeyPress)** hook.

[editline]27th January 2011[/editline]

There was another hook I was going to reccomend but I forgot it, since KeyPress is limiting.

“You can not use this hook to detect KEY_ keys.”

I wanted to use Q. (“KEY_Q”)

Nothing else I can use the solve this?

To use Q to open a menu, you can use **[Gamemode.OnSpawnMenuOpen


Use the KEY_ prefix and the other column not the ids

[lua]if input.IsKeyDown(KEY_E) then

Thanks, That works. :3