[SOLVED] How to get onTouchEvents?

Hello everybody,
I have a program running on a Windows PC and I’m using mouse movement for rotating and zooming the Camera.
This part works fine (It’s not a game but a program for CAD (Computer Aided Design) like AutoCAD).
Now we want to use the Program in an area of the company where the workers use windows tablet-PCs without a mouse and just a touchscreen.

But in the rawInputListener there are no "onTouchEvent"s fired.
When I move the finger over the screen there are only MouseMotionEvents and when I tap on the screen there are MouseButtonEvents.
I would like to use the Methods described here: TouchEvent (jMonkeyEngine3)
What do I have to do to get onTouchEvents?
the code ist incomplete and just to show how I try to do it. But it doesn’t work for Touchscreens.

inputManager.addMapping("TouchInput",new TouchTrigger(TouchInput.ALL));


private RawInputListener rawInputListener = new RawInputListener() {
    public void onTouchEvent(TouchEvent te) {
        System.out.println("rawInputListener TouchEvent fired");

Use an Android phone/tablet. That’s the only place touch events have been implemented.

On Windows, touch events are mouse events. No code has ever been written to do differently.

1 Like

But when I use the “pinch” gesture zooming works without having implemented something. Why ?

are you sure it is a gesture but not a mouse event ?

Works where?

Now I understand what is happening.
Usually I use the Wheel on the Mouse for zooming

inputManager.addMapping("WheelPositive", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false));
inputManager.addMapping("WheelNegative", new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true));

inputManager.addListener(analogListener, "WheelPositive",   // Zoom in
                                         "WheelNegative");  // Zoom out
private AnalogListener analogListener = new AnalogListener() {

    public void onAnalog(String name, float value, float tpf) {
		if (name.equals("WheelPositive")){     

When I use the pinch gesture the AXIS_WHEEL event is fired.
Thats why zooming by pinch works “out of the box”