Joystick button mappings?


diligentcircle

Well-Known Member
Joined
Aug 29, 2011
Messages
1,594
Age
30
Location
Milky Way galaxy
Website
onpon4.github.io
I can't find documentation on this, and neither experimentation nor an input test script I found made in Python have led me to an answer.


I know that the nubs are mapped, when set as joysticks, as joysticks 1 and 2, using axes 0 and 1 for X and Y, respectively. What I can't figure out are the buttons. An input tester script I found seemed to report that these are all on joystick 0, with the d-pad recorded as axis 0 and 1 (though I couldn't figure out which button was which), but when I tried to grab these controls for a game I'm working on, I had no response. I'm pretty sure it's not my program (which is a Python script using Pygame, by the way), because the Pandora's nubs (as axes, when set to the proper mode) were recognized just fine.


Is there something I'm missing? Is there maybe something I need to do to cause the buttons to be read as joystick buttons instead of keys?


And of course, what joystick and button number are each of the buttons?
 
Have you tried using Jkeys? I've been looking into this recently too but don't have a Pandora to test it on yet.


All the info on the key configurations should be up on the Wiki btw.

I'm not quite sure how jkeys would be helpful... it looks like something similar to joy2key, which I'd think would be useless. I'll take a look anyway.


I'm not looking for key mappings, I already know them. The d-pad is the arrow keys, L is right Shift, R right Ctrl, A/B/Y/X are Home/End/PgUp/PgDn. I want to know what joystick buttons each of them are. Example: the XBox 360 controller has the d-pad as HAT 0, the left stick as axes 0 and 1, A as button 0, B as button 1, etc. I want to know what these are for the Pandora buttons and d-pad and if there is anything I need to do first.
 
Last edited by a moderator:
I've had a similar post a while back wondering about this and got no reply...


My issue was there are a few DOS games that doesn't allow for mixed controls.. Like if you select Joystick, it expects the fire be a real joystick button not a keypress.. I was hoping there was some way to put the A/B/Y/X and L/R into a mode that emulated real joystick buttons..
 
In GLBasic it finds one joystick number 0 to be "gpio-keys". None of the buttons read. HatY always reads -1, for me anyway.


If I set the nubs to joysticks instead of mouse, I get three joysticks found. "gpio-keys" as 0, "nub0" as 1, and "nub1" as 2. The nubs report input, buttons don't.


I haven't gotten a lot of response either.


http://boards.openpa...always-reads-1/


EDIT: Clarification
 
Last edited by a moderator:
Well, I've got similar results with a Python script using Pygame (which uses SDL). The first joystick is reported as having 2 axes (not a HAT, interestingly) and 11 buttons (the number of buttons I expected), but only button 6, which is the Pandora button, has its input recognized.
 
Last edited by a moderator:
I don't think the game buttons are mapped to a joystick. Is there a reason you need them to be joystick buttons and can't just use them via keyboard?
 
You can also try qjoypad. You should always start joystick detection at joy1 instead of joy0.
 
I don't think the game buttons are mapped to a joystick. Is there a reason you need them to be joystick buttons and can't just use them via keyboard?

I can use keypresses, but it's a bit more of a hassle the way my config files work, and I don't like the idea of tying the default controls to key mappings that some people might not have.


If the answer is that there are no joystick mappings, I suppose my next questions are "Why not?" and "Why is a mostly non-functional joystick detected?"
 
If the answer is that there are no joystick mappings, I suppose my next questions are "Why not?"
Digging deep into my memory here, but I seem to recall that the original plan was to have it map both joystick and keyboard keys, but there was an issue with a lot of programs which would simultaneously detect the joystick press and the keyboard and perform different results. I believe this was a bug discovered just a few weeks before the Pandora was supposed to be released, so not enough time to give it a proper fix (ie, fix the affected applications) so it was simply removed with a TODO of fixing it later. As with most things, later is sometimes a long ways away, especially with the Pandora. :p


If my memory is correct, then it probably just needs to be re-investigated. File a feature request over at bugs.openpandora.org

and "Why is a mostly non-functional joystick detected?"
On that I have no clue.
 
Back
Top