SimpleApplet has no mouse control

Hi Everyone,



Firstly just let me say I'm new to JME so forgive me if this is an obvious question.  I have an applet derived from SimpleApplet.  Looking through the code for the BaseApplet I see it uses FirstPersonController to provide keyboard and mouse control of the camera …



… in my applet however only the keyboard controls function.



Do I need to give mouse control over to the Applet somehow?  I'm running it from the Eclipse debugger.



Thanks in advance for any help,



Richard

I've noticed this too, if I get a chance I'll look into it.

Wow, sorry this took so long.  It looks like that on SimpleApplet.java line 67, it disables the mouse control.  Hmm…I have no clue why exactly, probably because unlike SimpleGame the window can be resized.  But it looks like you can just comment it out.

      //((FirstPersonHandler) input).getMouseLookHandler().setEnabled(false);


:D
1 Like

Hi All,



Just in case anyone else is looking at this… My solution has been to disable the handler installed in the base SimpleApplet with removeAllFromAttachedHandler before installing my own like so…



// Set up the mouse and keyboard handlers



input.removeAllFromAttachedHandlers();

MouseLookHandler mouseLook = new MouseLookHandler(cam, 0.1f);

input.addToAttachedHandlers(mouseLook);



Richard