Basic game and xbox 360 game pad

Hi,

I want to use a xbox 360 pad with a new project. As soon I plug it in the box from the game template starts flying around everywhere.

I added inputManager.deleteMapping(SimpleApplication.INPUT_MAPPING_MEMORY); but it didn’t seem to do anything.

I am running the latest SDK and studio on OpenSuse 12.3…

any suggestions would be helpful

-nick

I believe this topic provides a working solution: http://hub.jmonkeyengine.org/forum/topic/xbox-360-controller-on-linux/

Sorry no, I understand the input mapping and it works just fine with TestJoystick.java

The issue is that without any code to handle joystick input, the Basic Game template is doing something with the joysticks input somewhere in simpleInitApp()?

When I run the template code with no game pad plugged in the blue cube does what is expected, when I plug in the game pad (no addition code), the cube starts flying around at random. How do I prevent this?

-nick

@nrathke said: Sorry no, I understand the input mapping and it works just fine with TestJoystick.java

The issue is that without any code to handle joystick input, the Basic Game template is doing something with the joysticks input somewhere in simpleInitApp()?

When I run the template code with no game pad plugged in the blue cube does what is expected, when I plug in the game pad (no addition code), the cube starts flying around at random. How do I prevent this?

-nick

If you have joysticks enabled for your app then fly cam will use the joysticks. It must be that one of the x,y axes is uncentered or something and causing the camera to turn.

That’s the thing… joystick is not enabled in my code. There is no input at all at this point that I have written, its very odd.

It only seems to do this on the Basic Game template, if I load TestChaseCamera.java everything work fine even with the game pad plugged in. So there has to be a way to force simpleInitApp() to not use the internal defaults and let the developer override the settings, but I have not figured that out yet.

The documentation has:

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:input_handling

  1. Remove Default Trigger Mappings
    inputManager.deleteMapping( SimpleApplication.INPUT_MAPPING_MEMORY );

but that seems to to have any effect.

.n

inputManager.deleteMapping( SimpleApplication.INPUT_MAPPING_MEMORY );

Deletes the ‘m’ key which dumps memory. It has nothing to do with flight.

Where you instantiate your application, setup the AppSettings to have use joysticks as false:
http://hub.jmonkeyengine.org/javadoc/com/jme3/system/AppSettings.html#setUseJoysticks(boolean)

or if you want to clear all mappings:

[java]
inputManager.clearMappings();
[/java]

Perfect thanks. Dot complete is a great thing… Should have seen that myself.

Though if you want to clear all mappings then that implies that you don’t want the default fly cam at all so you can just remove it or not include. Search for “remove flycam” and I suspect you’ll get 10 to 20 hits or so.