Thread: Keydown
View Single Post
  #9  
Old 05-03-2009, 12:12 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by [email protected] View Post
In your method you are specifiying what the keys are. What if I were to edit my DEFAULT arrow keys to something like '1, 2, 3 and 4', your method would still be looking for your basic arrow keys

Oh, then you could do something like this:

PHP Code:
//#CLIENTSIDE
function GraalControl.onKeyDown(kcodekstringscode)
{
 for (
011i++)
  {
   if (
keydown(i)) 
    {
     
player.chat "The player has pressed the" SPC kstring SPC "key which is the default action for" SPC keyname(i);
    }
  }


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.

Last edited by Gambet; 05-03-2009 at 12:33 AM..
Reply With Quote