Talk:SDL Joystick mapping
I've used this code in 2 project, the button mappings were definitely correct.
Hmm... this is surprising: I tested it last night and my controls for X and Y were reversed. I tried several times. X is at the bottom, right? --Titousensei 17:22, 30 November 2005 (GMT)
Can you try RockDodger and see if the keys are correct ? I just pasted my code from it in here.
I'll try it tonight. I've been studying the sources of nkSnes2x, and their joystick mappings match yours. I need to do more testing. ... maybe it was just too late for me to be coding ;-)
I tried RockDodger and it works as expected. The error must be in my code, sorry about that. --Titousensei 19:42, 1 December 2005 (GMT)
ok it turns out the button mappings in open2x sdl didnt match the ones used on the retail gp2x. fixed in cvs -- theoddbot
I linked to the Common User Interface Recommendations. I thought the Suggested Joystick Configuration should get linked in unless there was better code for testing it. Feel free to change it if you disagree; I have no ego left.) Gizbot 22:12, 16 February 2006 (PST)
- Sorry, can someone clarify what the results were. My Y is definitely 14 and my X 15 (contrary to the article) - I've changed my header for now, but which is supposed to be correct? - Wite Noiz 14:06, 13 June 2006 (PDT)
- It's the same for me. L and R also seem to be swapped. --Hammy lite 03:02, 15 June 2006 (PDT)
Daid: With the 'offical' SDK, the mapping shown on the wiki page is right. I just tested it myself. Maybe some other SDKs work diffrently?
Editing the main article
Can people please stop editing the main article with EDIT: Blah blah - it makes a mess. --Alvin 04:41, 27 October 2006 (PDT)
Cleaned up the main article. Are the examples pointless to be there? I think example headers are adequate.--Alvin 06:42, 27 October 2006 (PDT)
What?
What's the point of any of the following? In SDL_joystick.h all the buttons are defined as GP2X_VK_(and the button name).
C
#define GP2X_BUTTON_UP (0) #define GP2X_BUTTON_DOWN (4) #define GP2X_BUTTON_LEFT (2) #define GP2X_BUTTON_RIGHT (6) #define GP2X_BUTTON_UPLEFT (1) #define GP2X_BUTTON_UPRIGHT (7) #define GP2X_BUTTON_DOWNLEFT (3) #define GP2X_BUTTON_DOWNRIGHT (5) #define GP2X_BUTTON_CLICK (18) #define GP2X_BUTTON_A (12) #define GP2X_BUTTON_B (13) #define GP2X_BUTTON_Y (14) #define GP2X_BUTTON_X (15) #define GP2X_BUTTON_L (10) #define GP2X_BUTTON_R (11) #define GP2X_BUTTON_START (8) #define GP2X_BUTTON_SELECT (9) #define GP2X_BUTTON_VOLUP (16) #define GP2X_BUTTON_VOLDOWN (17)
NOTE: for dynamically linked Open2x applications and recent versions of SDL, the following mapping should be used instead.
#define GP2X_BUTTON_UP (0) #define GP2X_BUTTON_DOWN (4) #define GP2X_BUTTON_LEFT (2) #define GP2X_BUTTON_RIGHT (6) #define GP2X_BUTTON_UPLEFT (1) #define GP2X_BUTTON_UPRIGHT (7) #define GP2X_BUTTON_DOWNLEFT (3) #define GP2X_BUTTON_DOWNRIGHT (5) #define GP2X_BUTTON_CLICK (18) #define GP2X_BUTTON_A (12) #define GP2X_BUTTON_B (13) #define GP2X_BUTTON_X (14) #define GP2X_BUTTON_Y (15) #define GP2X_BUTTON_L (10) #define GP2X_BUTTON_R (11) #define GP2X_BUTTON_START (8) #define GP2X_BUTTON_SELECT (9) #define GP2X_BUTTON_VOLUP (16) #define GP2X_BUTTON_VOLDOWN (17)
- Tradition. Orkie 13:20, 13 January 2008 (PST)