Right mouse button move

Hello people , again.

Thanks for you answers.

Now i have next question : Slick2d. How can i check if i press RBM and move it , how to calculate how much i move?
I mean x and y coordinates.

Difference in position at mouseButtonDown, and mouseButtonReleased. It may not be their exact names, but both features should be in there.

There is a mouseDragged method that you can use in MouseListener :slight_smile:
Then add the MouseListener to Input.

I don’t know if this applies to Slick2d but to know if the button pressed is the Right one…

public void mousePressed(MouseEvent evt) {
		if (evt.isMetaDown())  // Right click?
		{
			//Right Mouse
         startX = evt.getX();
			startY = evt.getY();
		}else{
         //Left Mouse
     }
}

evt.isMetaDown() is TRUE if it’s the Right mouse button that triggered the event.

@gbeebe
Slick2D is completely different Java2D, where Slick2D doesn’t have a MouseEvent object, but 3 int parameters: the button type, the x coordinate, and the y coordinate.

I was just thinking that since Slick2d’s InputListener extends MouseListener that the default events would still be triggered.

thanks ra4king