private void onTouchEventQueued(TouchEvent evt, NiftyInputConsumer nic) {
        if (inputManager.isSimulateMouse()) {
            return;
        }

        x = (int) evt.getX();
        y = (int) (height - evt.getY());

        // Input manager will not convert touch events to mouse events,
        // so we must do it ourselves.
        switch (evt.getType()) {
            case DOWN:
                if (inputPointerId != -1) {
                    // Another touch was done by the user
                    // while the other interacts with nifty, ignore.
                    break;
                }

                inputPointerId = evt.getPointerId();
                handleMouseEvent(0, true, nic, evt);

                break;
            case UP:
                if (inputPointerId != evt.getPointerId()) {
                    // Another touch was done by the user
                    // while the other interacts with nifty, ignore.
                    break;
                }

                inputPointerId = -1;
                handleMouseEvent(0, false, nic, evt);

                break;
        }
    }
@param height The height of the viewport. Used to convert
bottom-left origin to upper-left origin.
jme3-niftygui/src/main/java/com/jme3/niftygui/InputSystemJme.java