Right clicking problems

I’m having problems with my gaomon pen. When I’m using the aseprite, and when I minimize the program and go back in, the right click won’t work and instead would right click to the tab instead. When I keep testing this problem, it doesn’t respond with the pen when I put the program right back. It’ll respond when I use the mouse.
I hope someone will understand what I’m saying.