AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Detect key (https://forums.alliedmods.net/showthread.php?t=220987)

CodeStepper 07-16-2013 18:19

Detect key
 
Hi!
It is possible to detect which key user is pressing?
I know that I can do this:
PHP Code:

public client_PreThink(id)
{
new 
button get_user_button(id);


But it only capture a main keys. And what about h g or something else?

And it is possible to create own impulse which were be captured by client_impulse function?

YamiKaitou 07-16-2013 18:26

Re: Detect key
 
Quote:

Originally Posted by CodeStepper (Post 1992410)
It is possible to detect which key user is pressing?

No

Quote:

But it only capture a main keys. And what about h g or something else?
You can only catch the actions, not the keys

Quote:

And it is possible to create own impulse which were be captured by client_impulse function?
register_impulse

CodeStepper 07-17-2013 05:55

Re: Detect key
 
Ok. Thanks

baneado 07-17-2013 12:59

Re: Detect key
 
G for example it's drop command, so you can do this
PHP Code:

register_clcmd("drop""clcmd_yourfunction"


fysiks 07-17-2013 17:07

Re: Detect key
 
Quote:

Originally Posted by baneado (Post 1992970)
G for example it's drop command, so you can do this
PHP Code:

register_clcmd("drop""clcmd_yourfunction"


That is not always true which is why the actual answer to the question is no.


All times are GMT -4. The time now is 06:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.