Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   User keys (https://forums.graalonline.com/forums/showthread.php?t=69196)

Skyld 10-06-2006 04:57 PM

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.

Admins 10-06-2006 07:46 PM

Would be interesting yes, although it is not always simple, internally it is using the DirectInput key codes, XWindows or Mac Cacoa, it is not working exactly the same as keydown2 which is just checking the keyboard state. Also it would need to return an array of keycodes I guess.


All times are GMT +2. The time now is 10:50 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.