How to use Function keys :D

So i have a menu and i want to bring up the menu by pressing f1 or f2, or any function key really ( but not F10 :wink: )

i can bring up my menu through console using this though


concommand.Add( "Open_Menu", Menu )

**[Gamemode.ShowHelp

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.ShowHelp)**
**[Gamemode.ShowSpare1

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.ShowSpare1)**
**[Gamemode.ShowSpare2

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

These are called when keys F1-F3 are pressed me thinks.

alright that worked, thanks alot :smiley:

Doubt itโ€™s any use to you, but you can also have most/all function keys.
But for the sake of being simple, use what ralle posted, itโ€™s much easier to deal with.

[lua]
KEY_F1
KEY_F2
KEY_F3
KEY_F4
KEY_F5
KEY_F6
KEY_F7
KEY_F8
KEY_F9
KEY_F10
KEY_F11
KEY_F12
[/lua]

Commonly, only F1-F4 is used. With the links ralle sent you.
Check wiki for usage for the keys I posted as KeyPress only allows IN_ keys.