Issue with pen (Android)

That’s really amazing that you’re able to pull this off, I wouldn’t even know where to start looking… Desktop btw means Windows?

Yes but it’s for development only, maybe in the future I’ll release a desktop version but nothing planned for now.

That’s interesting. Sounds good :+1:

Sorry to bump this, but I think this is the biggest issue on android right now when working with high res models.

It happens almost always now if I’m not very careful with my hand movements, like every 2 minutes and I get stuck in this mode where it’s tricky to get out of.

I was thinking, it looks like some touch events might disappear for some reason but maybe it could be fixed experimentally by removing all internal finger down states once the pen is detected?

Can you reproduce the issue if you sculpt with your finger?

No just the pen, fingers cause no issue at all.

Ok I think I know the issue, I’ll make quick release for android today.

Thanks! btw just downloaded a new release which still has the issues not sure if it’s that one already.

What is the version?
It should be 1.32.1

Oh I had 1.32, after updating it still says 1.32

I’ll try and reboot the tablet

No don’t bother, the update is not there yet.

Google needs to verify it first (it’s just that sometimes they send me the confirmation note a few hours after the release landed on the store for real).

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);        

    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?