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.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.