@pspeed here the mapping test for xbox controller using JME 3.0 http://eriq.lecture.ub.ac.id/files/2012/03/GamepadInfoDemo.zip
@eriqadams said:
@pspeed here the mapping test for xbox controller using JME 3.0 http://eriq.lecture.ub.ac.id/files/2012/03/GamepadInfoDemo.zip
Not sure what I'm supposed to do with this. The approach is sort of obsolete now since you don't have to register with magic IDs anymore.
The most helpful thing people can do is run TestJoystick with the new code and make sure the sticks map properly to the picture… and if not then I’m interested in a screen shot or even better, the text joystick dump file.
A bonus is if the buttons match too… though the right buttons are sort of hit or miss. I have 5 pads with the same mapping and one odd one out.
great great work!
@t0neg0d said:
Priceless!!! I've been wanting to say that for a long time... hahahahahaahahaha
Well, I was going to just throw rocks into a pond until the problem solved itself. I don't know why I never thought of writing code. ;) ;) ;)
I’ve made some good progress on this. I’ve refactored a good deal of the joystick support (though it’s still backwards compatible, it’s a lot simpler and exposes a new JoystickAxis class) and I can now use both joysticks on the flycam and it works with all of my gamepads so far. I have four more coming tomorrow and I will test with those.
Tomorrow night I will alter the joystick test to display information for all of the configured joysticks. But not tonight.
My testing “harem”… all of these work as expected with the new code that I will commit later tonight.
So, what will you do with all these when you’re done? Wear them on your head as decoration?
@Momoko_Fan said:
So, what will you do with all these when you're done? Wear them on your head as decoration?
You never know. I have a lot of computers here... so they may get spread around for the kids to use.
I thought the Final Fantasy one in the upper right looked ridiculous when I bought it... but it is the most comfortable one out of the whole bunch. Now maybe I'll have to see about getting extensions for my PS3 controllers.
@Momoko_Fan said:
So, what will you do with all these when you're done? Wear them on your head as decoration?
Make a star trek control console xD
@normen said:
Make a star trek control console xD
Hehe... there is a part of me that longs to make custom electronic junk that interacts with a computer... and most of these were $10 or less. So yeah, maybe I'll crack them open and use them for a pre-wirted cheap USB interface to "insert project here". :)
I have the same right analog stick bug that makes it useless. Have you looked into how to fix it?
Joystick[name=Logitech Dual Action, id=0, buttons=12, axes=5]
@weolopez said:
I have the same right analog stick bug that makes it useless. Have you looked into how to fix it?
Joystick[name=Logitech Dual Action, id=0, buttons=12, axes=5]
I've rewritten much of the joystick stuff but I haven't committed it yet. I will be doing that today, I hope.
@pspeed : Do you have your ps3 sixaxis contoller working now with your joystick rewrite ? jME doens’t find my ps3 dualshock 3 controller, but it’s available in the Devices and printer window (Windows).
@Vortex said:
@pspeed : Do you have your ps3 sixaxis contoller working now with your joystick rewrite ? jME doens't find my ps3 dualshock 3 controller, but it's available in the Devices and printer window (Windows).
I can get my PS3 controller to show up in devices by just plugging it in but it's not recognized by windows as a game controller. All of the special drivers and stuff I've tired don't work for whatever reason. Maybe you will have better luck.
The key is to get it to show up under Control Panel -> Game Devices.
If it doesn't show up there then JME will never see it.
New Joystick handling code is now checked into SVN. I think I missed tonight’s nightly but the eager beavers who build from SVN will have access to it.
Summary of changes:
-new JoystickAxis and JoystickButton classes were added to provide information about the axes and buttons of a Joystick.
-Joystick was converted to an interface with an abstract implementation that the specific joystick providers can use to have more specific functionality.
-Joystick now has some getAxis()/getButton() related methods that return the JoystickAxis objects and JoystickButton objects, respectively.
-Joystick now has getAxis(name)/getButton(name) that will return an axis or button with a particular name.
-JoystickAxis has some common names.
-Joystick has convenience methods for getting the X/Y/POV axes of a joystick.
-JME converts the single HAT input to two separate axes. This is now exposed as two virtual JoystickAxis objects. The HAT itself is also available should one wish to go to it directly.
-The joystick axis and button events now have the actual JoystickAxis and JoystickButton objects. This makes raw input listeners very powerful if trying to watch all joystick inputs… say for testing/debugging… or for writing a tool that lets you intelligently map joystick inputs to functions. When the event comes in, you have all of the information about the source of the event.
-FlyByCamera has been updated to register itself with all connected joysticks. It also configures itself differently if a gamepad style controller is detected. Camera direction becomes the right analog stick and movement becomes the left analog stick. DPAD up and down move the camera up and down. The “Select” button (“Button 8” in a standard mapping) will toggle Y inverted (because the default y+ look up, y- look down makes me sick to my stomach really fast.).
The TestJoystick test has gotten a significant upgrade. It looks like this now:
Any connected joystick can be used to move the sticks and highlight the buttons on the game controller pictured. This allows a user to test that their joystick follows what seem to be mostly default mappings. (5 out of 6 of my gamepads have consistent mapping for the right-side buttons. 4 out of 6 have consistent mapping of the front buttons… but the ones that don’t simply invert the top and bottom.)
The button and axis dump in the HUD changes to the most recently active joystick.
Also, when the test is run, a joystick-####.txt file is dumped to the current directory. It contains a raw dump of all of the joysticks and their axes/buttons.
I think that is enough for now until people start finding problems with it. Phew!

@pspeed sweet!
my TestJoystick dump:
Joystick[0]:Gamepad for Xbox 360 (Controller)
buttons:10
JoystickAxis[name=Y Axis, parent=Gamepad for Xbox 360 (Controller), id=0, logicalId=y, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=X Axis, parent=Gamepad for Xbox 360 (Controller), id=1, logicalId=x, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Y Rotation, parent=Gamepad for Xbox 360 (Controller), id=2, logicalId=ry, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=X Rotation, parent=Gamepad for Xbox 360 (Controller), id=3, logicalId=rx, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Z Axis, parent=Gamepad for Xbox 360 (Controller), id=4, logicalId=z, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Hat Switch, parent=Gamepad for Xbox 360 (Controller), id=5, logicalId=pov, isAnalog=false, isRelative=false, deadZone=0.0]
JoystickAxis[name=JME:POV_X, parent=Gamepad for Xbox 360 (Controller), id=6, logicalId=pov_x, isAnalog=false, isRelative=false, deadZone=0.0]
JoystickAxis[name=JME:POV_Y, parent=Gamepad for Xbox 360 (Controller), id=7, logicalId=pov_y, isAnalog=false, isRelative=false, deadZone=0.0]
my report:
my left stick matched both axes of the left stick on gui correctly
my left stick pressed in showed as select on gui
my right stick did nothing at all on gui
my right stick pressed in showed as start on gui
my right trigger showed as right stick pressed right on gui
my left trigger showed as right stick pressed left on gui
my select button showed as left trigger on gui
my start button showed as right trigger on gui
my right and left shoulder buttons above the triggers mapped correctly
my HAT switch also mapped correctly
my right side button are all showing on gui, but not in their proper locations
note:
i believe the 2 triggers in an Xbox360 controller are actually analog inputs,
with one that measures positive, and the other, negative (of one axis).
Here’s mine:
Joystick[0]:Saitek P2900 Wireless Pad
buttons:14
JoystickAxis[name=Z Axis, parent=Saitek P2900 Wireless Pad, id=0, logicalId=z, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Z Rotation, parent=Saitek P2900 Wireless Pad, id=1, logicalId=rz, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Y Axis, parent=Saitek P2900 Wireless Pad, id=2, logicalId=y, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=X Axis, parent=Saitek P2900 Wireless Pad, id=3, logicalId=x, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Hat Switch, parent=Saitek P2900 Wireless Pad, id=4, logicalId=pov, isAnalog=false, isRelative=false, deadZone=0.0]
JoystickAxis[name=JME:POV_X, parent=Saitek P2900 Wireless Pad, id=5, logicalId=pov_x, isAnalog=false, isRelative=false, deadZone=0.0]
JoystickAxis[name=JME:POV_Y, parent=Saitek P2900 Wireless Pad, id=6, logicalId=pov_y, isAnalog=false, isRelative=false, deadZone=0.0]
The DPAD and left control stick work fine.
The right control stick axes are flipped somewhat. Right control stick axes are switched, and Y axis has a flipped sign. E.g.:
Negative X Axis (Left) => Negative Z Rotation in jME3
Positive X Axis (Right) => Positive Z Rotation in jME3
Negative Y Axis (Down) => Positive Z Axis in jME3
Positive Y Axis (Up) => Negative Z Axis in jME3
The button locations are wrong, for me button 0 is on the left, but on your picture button 0 is at the top. I don’t know if that matters much.
The select and start buttons for me are on the far right side. If you look at this image:
http://s3.amazonaws.com/wootsaleimages/Saitek_P2900_Wireless_First_Person_Shooter_Gamepad1fbStandard.jpg
The white button on the far right is the start button and the black button below it is select.
@Decoy said:
my TestJoystick dump:
Joystick[0]:Gamepad for Xbox 360 (Controller)
buttons:10
JoystickAxis[name=Y Axis, parent=Gamepad for Xbox 360 (Controller), id=0, logicalId=y, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=X Axis, parent=Gamepad for Xbox 360 (Controller), id=1, logicalId=x, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Y Rotation, parent=Gamepad for Xbox 360 (Controller), id=2, logicalId=ry, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=X Rotation, parent=Gamepad for Xbox 360 (Controller), id=3, logicalId=rx, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Z Axis, parent=Gamepad for Xbox 360 (Controller), id=4, logicalId=z, isAnalog=true, isRelative=false, deadZone=0.0]
JoystickAxis[name=Hat Switch, parent=Gamepad for Xbox 360 (Controller), id=5, logicalId=pov, isAnalog=false, isRelative=false, deadZone=0.0]
JoystickAxis[name=JME:POV_X, parent=Gamepad for Xbox 360 (Controller), id=6, logicalId=pov_x, isAnalog=false, isRelative=false, deadZone=0.0]
JoystickAxis[name=JME:POV_Y, parent=Gamepad for Xbox 360 (Controller), id=7, logicalId=pov_y, isAnalog=false, isRelative=false, deadZone=0.0]
my report:
my left stick matched both axes of the left stick on gui correctly
my left stick pressed in showed as select on gui
my right stick did nothing at all on gui :(
my right stick pressed in showed as start on gui
my right trigger showed as right stick pressed right on gui
my left trigger showed as right stick pressed left on gui
my select button showed as left trigger on gui
my start button showed as right trigger on gui
my right and left shoulder buttons above the triggers mapped correctly
my HAT switch also mapped correctly
my right side button are all showing on gui, but not in their proper locations
note:
i believe the 2 triggers in an Xbox360 controller are actually analog inputs,
with one that measures positive, and the other, negative (of one axis).
Thanks for the data points. I didn't really expect the buttons to map correctly in all cases... so far this is just a best guess. The nice thing is that your game controller properly identifies itself (yours too Momoko) so we could put some alternate mappings into the joystick handling to deal with these.
Regarding the last, I think I need to dump the JoystickButtons as well as the axes. I wrote the dumper before I'd added JoystickButton. However, if the 2 triggers were actually analog inputs as you describe then I'd expect them to show up in the list of axes... which they didn't. But we don't yet have the full picture.