GP2X Gp2x Keys


motorollin

Member
Joined
Jul 31, 2007
Messages
163
Another question :rolleyes:

Here is a fragment of my player's input handler:
CODE
else if( event.type == SDL_JOYBUTTONDOWN )
{
switch( event.jbutton.button )
{
case VK_FY:
bullets.resize(bullets.size()+1);
bullets[bullets.size()-1].dir=0;
break;



case VK_UP:
yVel -= player_speed;
playersprite=0;
break;


All of the directional keys work, but FK_FY does nothing when I press the Y key on the GP2X. The same code used for VK_FY is duplicated for SDLK_w under event.type SDL_KEYDOWN, and this works when I press the w key when running in Windows.

At the top of main.c I have the following:

CODE
enum MAP_KEY
{
VK_UP , // 0
VK_UP_LEFT , // 1
VK_LEFT , // 2
VK_DOWN_LEFT , // 3
VK_DOWN , // 4
VK_DOWN_RIGHT , // 5
VK_RIGHT , // 6
VK_UP_RIGHT , // 7
VK_START , // 8
VK_SELECT , // 9
VK_FL , // 10
VK_FR , // 11
VK_FA , // 12
VK_FB , // 13
VK_FX , // 14
VK_FY , // 15
VK_VOL_UP , // 16
VK_VOL_DOWN , // 17
VK_TAT // 18
};
 
mrsnature said:
in some versions of the gp2x sdl libraries the X and Y buttons are switched
Interesting, but no it wasn't that. It was me being a doofus. I haven't compiled for the GP2X since adding the Bullet class and its corresponding sprite. I just forgot to copy the png for the sprite :blush:
 
Last edited by a moderator:
Back
Top