Thread: Keydown
View Single Post
  #2  
Old 05-02-2009, 10:12 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Not sure I completely understand what you're trying to do but I suppose you could do something like this:

PHP Code:
//#CLIENTSIDE
function GraalControl.onKeyDown(kcode, kstring, scode)
{
 
temp.keyList = {{38, 0}, {37, 1}, {40, 2}, {39, 3}}; //Up, Left, Down, Right
 
 
for (i = 0; i < keyList.size(); i++)
  {
   if (
keyList[i][0] == kcode)
    {
     
player.chat = keyname(keyList[i][1]);
    }
  }
} 
Reply With Quote