Hi @all,
is there any possibility to use the default awt mouse input system on a canvas like mouselistener, mousemotionlistener etc. I currently miss a handling for mouse double click events.
Regards
Moe
Yeah, just use them like normal but be sure to wrap calls to jME in Callables because you will receive the events on the AWT thread:
[snippet id=“10”]
Well ok, but doing the following never leads on to an output:
[java]public final Canvas getCanvas() {
if (canvas == null) {
createCanvas();
JmeCanvasContext ctx = (JmeCanvasContext) context;
ctx.setSystemListener(this);
canvas = ctx.getCanvas();
startCanvas();
enqueue(new Callable<Void>() {
@Override
public Void call() throws Exception {
canvas.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
System.out.println("RELEASED");
}
});
return null;
}
});
}
return canvas;
}[/java]
Uh, try using the parent container. It works, I have been doing it in jMP too.
@normen: I tried to use the awt mouse things at the parent (and the parent of the parent, etc.) and at no point i received an awt event. Could you give me a simple code snippet which uses the awt mouse inputs?
Regards
Moe
No, I dont have any.