How can i get my Mouse to move the AbsoluteMouseObject?

Hi, my problem is , that I probably do ot know what to add to the cursor.registerWithInputHandler(???);, I treid many different Ideas, but now I'm out of Ideas I could try.

The TestJmeDestop does not help really, since it seems that when i derive from VariableTimeStepGame there is no preconfigured input variable i could use :confused:



My code if needed:



         display.getRenderer().setBackgroundColor( ColorRGBA.black.clone() );
         rootNode = new Node("rootNode");
   
          sizey = properties.getHeight();
          sizex = properties.getWidth();
          render = properties.getRenderer();
         
         
         ZBufferState buf = display.getRenderer().createZBufferState();
          buf.setEnabled(true);
          buf.setFunction(ZBufferState.CF_LEQUAL);
         
          rootNode.setRenderState(buf);
          rootNode.setCullMode( SceneElement.CULL_NEVER );
          Hudnode = new Node( "desktop node" );
           rootNode.attachChild( Hudnode );
           Hudnode.setRenderQueueMode( Renderer.QUEUE_ORTHO );
           Hudnode.attachChild(new LoadingScreen());
           Hudnode.setLocalTranslation( display.getWidth() / 2, display.getHeight() / 2, 0 );
          
           JMEDesktop jmeDesktop = new JMEDesktop( "test internalFrame" );
           jmeDesktop.setup( display.getWidth(), display.getHeight(), false, input );
           jmeDesktop.setLightCombineMode( LightState.OFF );
          
           Hudnode.attachChild( jmeDesktop );
          
           desktopPane = jmeDesktop.getJDesktop();
         UIManager.setLookAndFeel( new MetalLookAndFeel() );
           cursor = new AbsoluteMouse( "cursor",(int) EngineBase.GetScreenSize().y,(int) EngineBase.GetScreenSize().y);
           TextureState ts = display.getRenderer().createTextureState();
           URL cursorLoc = EngineBase.class.getClassLoader().getResource("textures/cursor/cursor normal.png" );
           ts.setTexture(TextureManager.loadTexture(cursorLoc,Texture.MM_LINEAR,Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC,1,true));
           cursor.setRenderState( ts );
           AlphaState as = display.getRenderer().createAlphaState();
           as.setBlendEnabled( true );
           as.setSrcFunction( AlphaState.SB_SRC_ALPHA );
           as.setDstFunction( AlphaState.DB_ONE_MINUS_SRC_ALPHA );
           as.setTestEnabled( true );
           as.setTestFunction( AlphaState.TF_GREATER );
           cursor.setRenderState( as );
           cursor.registerWithInputHandler(?????);
           EngineBase.getHudnode().attachChild(cursor);
           cursor.setUsingDelta( false );
           cursor.getXUpdateAction().setSpeed( 1 );
           cursor.getYUpdateAction().setSpeed( 1 );
           cursor.setCullMode( SceneElement.CULL_NEVER );

I believe you just have to create a new InputHandler, attach your absolute mouse to it, and make sure you call InputHandler.update() in your update method…

Ah thanks, one of my ideas were the right, but I forgot to call the update function  :roll:



However this brings me to the next problem :confused:



How can i get the cursor to interact with awt stuff, (eg a simple button)?



code same as above just with

        input = new InputHandler();

        cursor.registerWithInputHandler(input);

added








Sorry, you have now reached the limits of my knowledge in this area (I don't use jME-Desktop).  Maybe one of the tutorials…