Change default input handling on Android

Where do i modify the default behaviour of the input mappings on Android, for example I don’t want to rotate the camera, when the users moves his finger over the screen and I also want a different behaviour on zoom gestures. When I add my own mapping with a custom TouchListener the original mapping is not replaced and I don’t get how to remove it. inputManager.deleteMapping(…) sounds good but where are the default mappings defined? I could not find them in the SimpleApplication class.

That depends on what you are using to control the camera. By default, a FlyByCamera is enabled. If you didn’t disable it, the mappings are defined in that class.

This class only defines mappings for Mouse Events, but if MouseEvents are enabled in your MainActivity, then the touch events are converted into MouseEvents and used in FlyByCamera.

If you disable Mouse Events in MainActivity, FlyByCamera should stop controlling the camera with touch events. If you do that, you might as well disable FlyByCamera and create your own class to control the camera and use whatever mappings you want.

Ok thanks I think I get it. Does the FlyByCamera do anything else than defining the handling of WASD and the mouse movement?
I disabled the mapping of touchscreen events to mouse events with:

[java]inputManager.setSimulateKeyboard(false);
inputManager.setSimulateMouse(false);[/java]

is that correct this way? I like it that i have the normal camera behaviour on the desktop and custom one on the phone now. it helps when debugging :slight_smile:

@simon.heinen said: Ok thanks I think I get it. Does the FlyByCamera do anything else than defining the handling of WASD and the mouse movement?

Nope: that’s all it does. It’s literally it’s only reason for existence. If you don’t want that handling then you can safely remove the FlyCamAppState and replace it with your own handling or whatever. If you remove the app state in simpleInit() then it will never add its mappings.