Turning off mouse doesn't work after new release

Hey guys, I had this function:



[java]

/** function that disables mouse controls if true */

private void turnOffMouse(boolean b) {



if(b == true)

{

inputManager.deleteMapping(“FLYCAM_Left”);

inputManager.deleteMapping(“FLYCAM_Right”);

inputManager.deleteMapping(“FLYCAM_Up”);

inputManager.deleteMapping(“FLYCAM_Down”);

inputManager.deleteMapping(“FLYCAM_ZoomIn”);

inputManager.deleteMapping(“FLYCAM_ZoomOut”);



inputManager.setCursorVisible( true );

}

}

[/java]



that worked like a charm until I updated to the latest SVN and it doesn’t work. I was wondering if there’s a way to fix it without having to revert back to an earlier version.



thanks

Sounds like you turn off the mouse during initialize.



SimpleApplication was modified to turn the camera into an app state so that you can optionally include or uninclude it. (ie: you can easily have no fly cam at all). The down side of this change is that since it isn’t initialized until after simpleInit() runs then your deleteMapping calls are too early (though I’m surprised they didn’t throw an exception).



At least that’s the theory. I’d have to know more about your SimpleApplication setup to be sure.



If you want to get rid of the fly cam completely then you can either use the alternate constructor on SimpleApplication to just pass the app states you want or you can remove the app state during init:

stateManager.detach( stateManager.getState( FlyCamAppState.class ) );

1 Like

that solves it :slight_smile:



thanks