I use public boolean mouseDown(Event ev, int x, int y) to detect a click of the mouse.
I can distinguish between the right mouse button (ev.metaDown() is true) and the left and middle.
How can i differentiate the left from the middle button? Or if it is impossible with mouseDown, what should i use?
Try using ALT_MASK:
So your code might be:
Of course, all this is assuming you have a very good reason to use mouseDown in the first place, since it is deprecated. You should (probably) be using processMouseEvent instead, which gives you a MouseEvent to play with.