PDA

View Full Version : User keys


Skyld
10-06-2006, 05:57 PM
I would like to propose a read-only array which gives access to the user's key configuration. By example:
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:
function onKeyPressed(temp.keycode, temp.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, 08: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.