Disable mouse / keyboard move in SimpleGame

@nightwolf911 said:
this does not work in the latest version :S any other hints

[java]
inputManager.deleteMapping("FLYCAM_Left");
inputManager.deleteMapping("FLYCAM_Right");
inputManager.deleteMapping("FLYCAM_Up");
inputManager.deleteMapping("FLYCAM_Down");
inputManager.deleteMapping("FLYCAM_ZoomIn");
inputManager.deleteMapping("FLYCAM_ZoomOut");[/java]


I get the following error:
[java]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,6,main]
java.lang.IllegalArgumentException: Cannot find mapping: FLYCAM_Left
at com.jme3.input.InputManager.deleteMapping(InputManager.java:573)
at com.kiva.sim.animation.animator3d.Jme3Cinematics.turnOffMouse(Jme3Cinematics.java:403)
at com.kiva.sim.animation.animator3d.Jme3Cinematics.simpleInitApp(Jme3Cinematics.java:378)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)
at java.lang.Thread.run(Thread.java:619)
Feb 24, 2012 10:28:29 AM com.jme3.renderer.lwjgl.LwjglRenderer cleanup
INFO: Deleting objects and invalidating state
Feb 24, 2012 10:28:29 AM com.jme3.input.lwjgl.LwjglMouseInput destroy
INFO: Mouse destroyed.
Feb 24, 2012 10:28:29 AM com.jme3.input.lwjgl.LwjglKeyInput destroy
INFO: Keyboard destroyed.
Feb 24, 2012 10:28:29 AM com.jme3.system.lwjgl.LwjglAbstractDisplay deinitInThread
INFO: Display destroyed.[/java]


SimpleApplication was refactored to allow complete and total removal of the fly cam. The proper way to get rid of it now is to use the alternate super() constructor and not pass the fly cam state or to remove the fly cam state on init.

Because of these changes, the fly camera mappings aren't added until after simpleInit() and so the mappings don't exist yet.

I just responded here with slightly more detail:
http://hub.jmonkeyengine.org/groups/general-2/forum/topic/turning-off-mouse-doesnt-work-after-new-release/#post-164828
1 Like