Hooka
That Guy!
Hey, just wanted to try and get some confirmation on this as I'm 99% sure of most of these, but still unsure about the shoulder buttons...
Buttons: SDLK_*:
A SDLK_HOME
B SDLK_END
X SDLK_PAGEDOWN
Y SDLK_PAGEUP
START SDLK_LALT
SELECT SDLK_LCTRL
L SDLK_RSHIFT (?)
R SDLK_RCTRL (?)
Personally this is how I treat the left analog (as a mouse):
*note: I set HalfScreenX and HalfScreenY as half of the SizeX and SizeY that I used to init SDL's video*
What is worrying me is how I'm going to use the second nub later on in a similar method without causing all sorts of clicks, or if I stop it from registering clicks somehow, how I'll reset it to what it was before running my app... (useful for games that use 2 analogs)
Once again, feel free to laugh at my silly ways of handling stuff and ignorance to proper form, but I've searched around for this info a few times and can't find a nice, clean place where it is all sitting together so I thought I'd dump it here before other people go out of their way to do what I did and watch what hitting the buttons in web browsers, menus and mousepad to figure out what the buttons are mapped to.
Confirmation of the L and R triggers would be nice, but I'm sure I'll give it my usual brute force tests and find out if I'm right or not
Buttons: SDLK_*:
A SDLK_HOME
B SDLK_END
X SDLK_PAGEDOWN
Y SDLK_PAGEUP
START SDLK_LALT
SELECT SDLK_LCTRL
L SDLK_RSHIFT (?)
R SDLK_RCTRL (?)
Personally this is how I treat the left analog (as a mouse):
*note: I set HalfScreenX and HalfScreenY as half of the SizeX and SizeY that I used to init SDL's video*
Code:
//Small hack to get Pandora's left nub to act like a joystick!
#ifdef TARGET_PANDORA
int MouseX, MouseY;
SDL_GetMouseState(&MouseX, &MouseY);
int DeltaX = MouseX - HalfScreenX;
int DeltaY = MouseY - HalfScreenY;
SDL_WarpMouse(HalfScreenX, HalfScreenY);
#endif
//Left
if (DeltaX < -5)
{
//Do whatever for Left here!
}
//Right
if (DeltaX > 5)
//Up
if (DeltaY < -5)
//Down
if (DeltaY > 5)
*Note: you don't have to use 5 and -5, I just do cause it seems to give a good mix of dead area with diagonal availability in RACE!*
You could also use DeltaX and DeltaY to get an angle and distance for a more analog approach if you wanted, this is just what I use for things with 4 ordinals...
What is worrying me is how I'm going to use the second nub later on in a similar method without causing all sorts of clicks, or if I stop it from registering clicks somehow, how I'll reset it to what it was before running my app... (useful for games that use 2 analogs)
Once again, feel free to laugh at my silly ways of handling stuff and ignorance to proper form, but I've searched around for this info a few times and can't find a nice, clean place where it is all sitting together so I thought I'd dump it here before other people go out of their way to do what I did and watch what hitting the buttons in web browsers, menus and mousepad to figure out what the buttons are mapped to.
Confirmation of the L and R triggers would be nice, but I'm sure I'll give it my usual brute force tests and find out if I'm right or not