Issue with pen (Android)

Ah ok still that’s pretty quick!

The update should be live (1.32.1)

Got it (1.32.1) but unfortuately same two issues with the button and with the stuck navigation. Actually it now always goes into this stuck navigation mode when I put down the pen with 2 fingers down, where before it sometimes didn’t .

I was thinking the two fingers received a AMOTION_EVENT_ACTION_CANCEL even each but I guess it’s not the case.

Just to be clear the 2 issues are:

  • you hold the button and then start to draw but nothing happens
  • you translate the camera with 2 fingers then start putting down the SPen and then release the spen and you are lock in pan mode

I don’t really want to make a new release without being sure, so either it will have to wait for next release or I can make an internal test if you are in.

Otherwise I would need the result of (in the 2 scenarios)

    static void sendTouchEvent(int pid, int idx, int action, MotionEvent me) {
        // AppLib.onTouchEvent(pid, action, me.getX(idx), me.getY(idx), me.getPressure(idx), me.getToolType(idx),
        //                     me.getSize(), me.getButtonState());

        debug_log(pid, action);        
    }

    @Override
    public boolean onTouchEvent(MotionEvent me) {
        int action = me.getActionMasked();
        if (action == MotionEvent.ACTION_MOVE) {
            for (int pid = 0; pid < ANDROID_MAX_POINTER; ++pid) {
                int idx = me.findPointerIndex(pid);
                if (idx >= 0) sendTouchEvent(pid, idx, action, me);
            }
        } else {
            int idx = me.getActionIndex();
            int pid = me.getPointerId(idx);
            sendTouchEvent(pid, idx, action, me);
        }

        return true;
    }

Ok I was being stupid.
It indeed seems that AMOTION_EVENT_ACTION_CANCEL is called only for one fingers, so I indeed need to release all the points as you suggested (and as I was doing before on the previous release).

However I still have no idea why the first scenario doesn’t work (pencil while holding button doesn’t work).

At the moment the pen touches the tablet with the button held, the only thing that happens is that the sub icon (in case of the normal Brush) gets highlighted, nothing else moves on the screen.

Yes, it already happens when I have 2 fingers down and the pen touches the tablet, then it should start to draw and forget about the fingers, but instead it goes into rotate mode where the pen acts as one finger and the position of a random one of the other fingers is the second finger. This position stays “active” even after I lift the fingers.

I’ll try to create the log (have never programmed Android so I’m slow… also it seems to be a different SDK, I was using the NDK Where I don’t have MotionEvent, just the AInputEvent)

Well if it’s annoying don’t bother, you don’t have to.
I’m handling the input event in Java (one of the few things that I did in Java).

Actually I think you already answered with

pen approach-hover-draw-hover-remove is AMotionEvent_getAction returns 9-7-7-…-7-7-10-0-2-2-…-2-2-1-9-9-7-7-…-7-7-10

Were you holding the button in that scenario?
From the look of it it should work… it should start sculpting on the 0

it can’t be annoying when I know it’s going to be the best sculpting app I’ve used on my tablet :slight_smile:

yes button was down, ran the sequence also with the button up, same result exactly.

Hmmm :confounded:

To make sure you can display the y position on the PRESS event (action=0).
I ignore the gesture if the PRESS event has an y position outside the frame… normally you should get a correct y… but who knows.

To be sure, do you have the same parameters?

Had settings exactly inverted, but with the same settings also, same issue. I’ll log the Y position too.

Thanks!

Just to be 100% sure, can you just confirm that you get at least one AMOTION_EVENT_ACTION_CANCEL event when you do the scenario “two fingers AND then pencil down” (I don’t need the sequence, just want to confirm you get at least one cancel event).

There must be a difference otherwise it would work in (illustrator, adobe sketch, nomad).
Except for the y position, maybe the pressure is 0 during the stroke (would be very surprising), or a pointer index that is not 0 (don’t think so either).

I get exactly 1 AMOTION_EVENT_ACTION_CANCEL with 1 or 2 fingers doesn’t matter. The log is pretty unreadable atm. This is 2 fingers down, then pen down&up, then 2 fingers up

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 0):
-----> action 0 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 261):
-----> action 5 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 1 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 355.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 354.500000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 354.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 353.500000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 352.500000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 352.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 352.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 351.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 351.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 350.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 350.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 350.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 350.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 350.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 2 pointers (combined action 3):
-----> action 3 pointerIndex 0 pointerId 0 toolType 1 with buttonState 0 ypos 844.000000
-----> action 0 pointerIndex 1 pointerId 1 toolType 1 with buttonState 0 ypos 349.000000

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 0):
-----> action 0 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 548.578918

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 548.578918

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 547.111511

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 546.587463

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 546.692261

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 547.530762

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 548.054871

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 548.264526

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 547.740417

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 546.797058

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 545.958557

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 545.224854

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.805542

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.595947

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.595947

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.595947

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.595947

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.595947

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.386292

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 544.491150

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 546.797058

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 549.207825

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 1):
-----> action 1 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 549.207825
AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 9):
-----> action 9 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 550.465637

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 9):
-----> action 9 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 550.465637

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 550.465637

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 550.255981

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 547.635620

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 529.292786

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 503.298401

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 492.711975

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 10):
-----> action 10 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 492.711975

Thanks!

For this scenario, I know what is the issue and how to fix it (hopefully!).

It’s the other scenario that I’m wondering about (the one with 0 finger and simply trying to sculpt while holding the button).

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 9):
-----> action 9 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 615.870850

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 615.870850

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 615.870850

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 615.870850

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 616.185303

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 617.652710

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 618.596069

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 619.644226

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 620.692383

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 621.845337

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 622.998352

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 624.151306

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 625.304260

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 627.086182

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 627.819885

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 630.335449

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 632.012512

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 634.108826

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 635.681091

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 637.672546

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 639.244812

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 641.236328

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 643.751892

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 646.477112

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 649.307129

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 651.822754

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 655.386475

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.103210

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 10):
-----> action 10 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.103210

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 0):
-----> action 0 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.103210

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.208008

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.522461

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.836914

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.941711

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.941711

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.941711

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.941711

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.522461

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 660.103210

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 659.474304

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.845398

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.216492

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.377991

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 656.958740

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 656.958740

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 656.958740

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 656.958740

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 656.958740

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.168335

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.482788

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.587646

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.797241

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.006897

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.111694

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.216492

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.426147

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.740601

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.950256

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.950256

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.740601

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.530945

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.530945

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.321350

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.111694

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 658.111694

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.692444

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.273193

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 657.063538

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 656.644287

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 656.225037

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 655.805725

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 2):
-----> action 2 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 655.281677

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 1):
-----> action 1 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 655.281677

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 9):
-----> action 9 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 655.072021

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 9):
-----> action 9 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 655.072021

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 655.072021

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 654.862427

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 654.128723

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 653.185364

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 651.089050

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 648.468628

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 646.372314

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 639.873718

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 632.431763

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 623.836853

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 614.403442

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 604.236267

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 599.729187

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 7):
-----> action 7 pointerIndex 0 pointerId 0 toolType 2 with buttonState 34 ypos 599.205078

AINPUT_EVENT_TYPE_MOTION occured with 1 pointers (combined action 10):
-----> action 10 pointerIndex 0 pointerId 0 toolType 2 with buttonState 0 ypos 599.205078

Do you see anything that could explain why it wouldn’t work in other app as well? (illustrator/adobe sketch you mentioned).

Do the “undo count” increase when you stop the gesture? (the number on the bottom left of nomad).

No possible explanation yet

No, the undo count doesn’t increase when I approach with the button held down

Btw. I updated the “button pressed” log , earlier version I recorded too fast for logcat

The only hint I have is that the sub icon changes its color. So something must be different in the code going towards that, compared to the usual sculpting code…

If the button impacts the “sub”, then it’s as expected.
But sub toggling can’t prevent sculpting in Nomad (you change its state even while you are sculpting and it’s working fine).

If you were using the “button as smooth” then it could be a bit different because changing tool while you are sculpting with another tool can have side effects but it’s not even the case here.

I’m thinking maybe that’s the way you collect the inputs (NDK directly instead of Java).
Just to be clear you are not using the Samsung SDK or something?
Do you have a link to the example you went from?

Not using the Samsung SDK. I downloaded visual studio community edition, then it’s the HelloWorld sample (first in the list) which is pretty good, the only thing I changed is this for the logging.

static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) {
	struct engine* engine = (struct engine*)app->userData;
	if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {
		engine->state.x = AMotionEvent_getX(event, 0);
		engine->state.y = AMotionEvent_getY(event, 0);
		size_t nFingers = AMotionEvent_getPointerCount(event);
		int32_t combinedAction = AMotionEvent_getAction(event);
		LOGW("AINPUT_EVENT_TYPE_MOTION occured with %d pointers (combined action %d):", nFingers, combinedAction);
		for(int i=0; i < nFingers; i++)
		{	
			int32_t pointerId = AMotionEvent_getPointerId(event, i);
			int32_t toolType = AMotionEvent_getToolType(event, i);			
			float y = AMotionEvent_getY(event, i);
			if (toolType == 2)
				engine->state.angle = AMotionEvent_getPressure(event, i);
			else
				engine->state.angle = 0;
			int32_t actionUnmasked = (combinedAction >> (i * AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT)) & AMOTION_EVENT_ACTION_MASK;
			int32_t buttonState = AMotionEvent_getButtonState(event);
			LOGW("-----> action %d pointerIndex %d pointerId %d toolType %d with buttonState %d ypos %f", actionUnmasked, i, pointerId, toolType, buttonState, y);
		}
		LOGW(" ");
		return 1;
	}
	return 0;
}

Sorry not helloWorld, it’s this one: