SA-MP Forums Archive
Detect another keyboard keys - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Detect another keyboard keys (/showthread.php?tid=404245)



Detect another keyboard keys - Diorturato - 02.01.2013

Hi. How to detect press on keyboard keys M, I, etc? I know how to detect keys Y, H and N, but no more.


Re: Detect another keyboard keys - Babul - 02.01.2013

this is not, and never will be, possible. hence a KeyDetect() in playerlogin callbacks.
you are limited to the native KEY_xxx constants.
little tip: sometimes its handy to use the numpad 2,4,6,8 (camera) keys to control a custom object cursor or similar.


Re: Detect another keyboard keys - Babul - 02.01.2013

@Diorturato: have a look at https://sampwiki.blast.hk/wiki/GetPlayerKeys
...and scroll down.
the camera keys DO work onfoot, here is 1 line which represents the camera):
Код:
KEY_ANALOG_UP 	2048 	- 	~k~~VEHICLE_TURRETUP~ 	NUM8
@******: i dont know if you recently looked at the configuration menu - its line 6 and 7 "conversation no" and "yes" (on foot), i mapped those to my joypad too, and the "camera left/right/down/up" are ALSO used by stick 2 on the joypad. the default configuration is set up to num 4/2/6/8 btw. saying that, YES, it is (sometimes / for me, always) very useful to remember those additional "keys" if using a joypad.
nevertheless, i already mentioned them above as KEY_xxx. the xxx was not meant as censoring ^^


Re: Detect another keyboard keys - Diorturato - 06.01.2013

Quote:
Originally Posted by Babul
Посмотреть сообщение
the camera keys DO work onfoot, here is 1 line which represents the camera):
Код:
KEY_ANALOG_UP 	2048 	- 	~k~~VEHICLE_TURRETUP~ 	NUM8
No. KEY_ANALOG_UP and KEY_ANALOG_DOWN working only invehicle.


Re: Detect another keyboard keys - Diorturato - 06.01.2013

KEY_ANALOG_LEFT and KEY_ANALOG_RIGHT working onfoot, but player can change key (San Andreas settings) ONLY invehicle. Wtf?