Well I turned the action menu off. So right now when the pen is near the surface the tablet as always detects it as a cursor but when I press the button it acts as a pan (I assume it triggers a mouse button or finger gesture). It would be nice if there was a distance check like is the pen actually touching the screen then it should trigger the touch gesture (canvas pen in this case) but if it’s away from the screen then just detect the button press and trigger the action/shortcut related to that button.
But I have to say I don’t know much about android development with the pen so I have no idea if there’s some bool flag or something which can check this.
But in other apps it works for me so I assume they found some way to do this.