![]() |
Keydown
Is there any way to get the keyname
HTML Code:
keyname(int keycode) returns stringfrom the function 'onKeyDown' HTML Code:
onKeyDown(keycode, key) Or, to just check if a player is pressing one of the detault keys set on Graals F3 options? |
Not sure I completely understand what you're trying to do but I suppose you could do something like this:
PHP Code:
|
u missed a param. :)
PHP Code:
|
Quote:
Thanks :D Only one problem- it doesn't detect the arrow keys for 'I,J,K,L'- any solutions? lol |
Quote:
Again, assuming I'm understanding what you're trying to do, then the solution I posted above should work if you just add to the array. The array I posted will only read the directional keys since I just made a quick model but you can add the keycodes for 'i, j, k, l' and give them the same numbers as the directionals (0, 1, 2, 3), which should return 'Up, Left, Down, Right' or whatever when you press those keys. |
Quote:
|
Quote:
Yes they are: PHP Code:
Those are the default keynumbers that correspond to the specified keynames, which is why if you did player.chat = keyname(0); it would return 'Up' and so forth. |
Quote:
|
Quote:
Oh, then you could do something like this: PHP Code:
EDIT: The default controls have keynumber values that range from 0-10 regardless of what key you assign to perform the action, which is why regardless of what keys you press to move your character, the keynumbers for directionals will always be 0, 1, 2, and 3. |
There is no way to read default key assignments. If there is, it's not been documented.
|
Quote:
For some reason the keys 'I,J,K,L' [movement] don't come recognized as movement keys... x-x |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 04:20 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.