Thread: User keys
View Single Post
  #1  
Old 10-06-2006, 04:57 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
User keys

I would like to propose a read-only array which gives access to the user's key configuration. By example:
PHP Code:
echo(keycodes[0]); 
... would give the keycode for the user's A key (if using an order similar to keydown()'s a,s,d,m,...)

It would then be possible to do something like:
PHP Code:
function onKeyPressed(temp.keycodetemp.keychar)
{
  switch (
temp.keycode)
  {
    case 
keycodes[0]:
    {
      
// user's A key
      
break;
    }

    case 
keycodes[1]:
    {
      
// user's S key
      
break;
    }
  }

It would allow for a lot more flexibility when creating custom keymaps and such.
Reply With Quote