bug report gp2x GetKeyState doesn't work
Posted: Sun Aug 12, 2007 8:47 pm
I don't think the GetKeyState has ever worked on the gp2x.
I used the code found in the Script Reference under the heading "GetKeyState:" on an actor's draw script. When playing under the "Game Mode" button the actor works as expected. When exported and played on the gp2x the actor won't move.
The code follows:
char *key = GetKeyState(); //Get entire keyboard state
if(key[KEY_RIGHT] == 1) //Test if right key is pressed
{
x = x + 5; //Move actor to right
}
if(key[KEY_LEFT] == 1) //Test if left key is pressed
{
x = x - 5; //Move actor to left
}
I used the code found in the Script Reference under the heading "GetKeyState:" on an actor's draw script. When playing under the "Game Mode" button the actor works as expected. When exported and played on the gp2x the actor won't move.
The code follows:
char *key = GetKeyState(); //Get entire keyboard state
if(key[KEY_RIGHT] == 1) //Test if right key is pressed
{
x = x + 5; //Move actor to right
}
if(key[KEY_LEFT] == 1) //Test if left key is pressed
{
x = x - 5; //Move actor to left
}