Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 10-06-2006, 07:46 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:17 AM.


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