Bug 421818 - Pen buttons not working with Artisul DS22 tablet
Summary: Pen buttons not working with Artisul DS22 tablet
Status: RESOLVED NOT A BUG
Alias: None
Product: krita
Classification: Applications
Component: Tablets (tablet issues are only very rarely bugs in Krita!) (show other bugs)
Version: 4.2.9
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-20 10:58 UTC by Guz
Modified: 2020-05-26 18:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Use mouse events as workaround (151.59 KB, image/png)
2020-05-26 18:27 UTC, Guz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guz 2020-05-20 10:58:45 UTC
SUMMARY
The driver is working correctly with any other software, except for Krita.

STEPS TO REPRODUCE
1. Select a Brush
2. Right-click with the Artisul DS22 pen

OBSERVED RESULT
Krita doesn't respond to the right-click (eg for showing the Popp up Palette). When doing the same action with a mouse, it works.

EXPECTED RESULT
Show the actions pertaining to right-click.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 10.15 (Catalina)
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2020-05-20 11:15:56 UTC
Since we don't have that hardware, and since tablet support is a matter for the OS in macOS, I don't think we can do much for you. I've never seen an Artisul tablet, so I don't know how configurable its driver is, but maybe the tablet is setup to send something else than a right-click?
Comment 2 vanyossi 2020-05-20 15:18:05 UTC
The driver is probably not sending the proper event. Other software might have a workaround. You can check what krita is seeing in the tablet tester:

Krita -> Preferences -> Tablet Settings -> Open tablet tester

A right click has the value B set to 2. "B=2" like this.

With mouse:  Mouse press X=186 Y=217 B=2
With pen:   Stylus press X=105.00 Y=137.00 B=2

Any other value of B is not seen as a right click. You either change the behaviour in your tablet driver configuration options for the right click (That is up to you to investigate how to do it). Or see if changing "Canvas Input settings -> Show popup palette" to also use the button the tablet is sending to show.
Comment 3 Guz 2020-05-20 23:26:48 UTC
Thanks! I did the test, and indeed Krita is actually seeing the tablet right-click correctly:

X=80 Y=177 B=2

Krita seems to be ignoring the tablet-right click only on the canvas, because it works on the layers, for instance. Any tips on what might be causing this?
Comment 4 Tiar 2020-05-20 23:42:14 UTC
You can use the "More detailed Tablet Events log" method from this page: https://docs.krita.org/en/contributors_manual/user_support.html#gathering-information to get the events that happens on the canvas itself. It might be less readable though. But we should get the information we need.

Also are you sure you haven't changed the popup palette shortcut (or context menu shortcut) to anything else in Canvas Settings? 

If no, do Artisul have any settings software? If yes, do you see two options: Right-click and Right Mouse Button? (I know sometimes there are two of them and the events are different?...). If so, you could change it, restart your PC and see if it helped.
Comment 5 Bug Janitor Service 2020-05-21 04:33:27 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 6 Tiar 2020-05-21 12:00:55 UTC
Setting back to NEEDSINFO.
Comment 7 Guz 2020-05-22 09:32:04 UTC
Hi. So I did the detailed tablet log, and it seems that Krita is recording the Right and middle mouse buttons correctly: https://bpa.st/D65Q

As for your questions:
- I've never changed the configuration to show the popup palette on the canvas input, and I even tried adding a new shortcut using the tablet pen's right mouse button, and it recorded successfully as "Mouse" and "Right Click". But when I go to test it out, the popup only shows up using the mouse, not the pen.

- The Artisul driver has only "Mouse Right Button", "Mouse Middle Button" and "Mouse Left Button" to choose from when configuring the pen's buttons, with the option to bind some keyboard keys with it. I configured the buttons to be middle and right-click.
Comment 8 Bug Janitor Service 2020-05-23 04:33:13 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 9 Guz 2020-05-26 12:32:43 UTC
Definitely the pen button clicks are nor working only in the canvas. Middle-click works for instance to drag up and down the windows on the left for instance, but it doesn't work when I try to rotate the canvas (Shift + middle-click).

Any help on this subject is appreciated.
Comment 10 Guz 2020-05-26 18:20:01 UTC
I noticed that every time I go out of the canvas and onto the layer docker for instance, the logger says "stop blocking mouse events" - and in there the mouse events all work.

Another curious fact is that for instance I right-click on a layer, and keep the pop-up open, and then right-click on the canvas, the popup palette appears. This is leading me to believe that for whatever reason when the pen enters the canvas realm, Krita is blocking the pen mouse events (but not the normal mouse).
Comment 11 Guz 2020-05-26 18:22:12 UTC
(In reply to Guz from comment #10)
> I noticed that every time I go out of the canvas and onto the layer docker
> for instance, the logger says "stop blocking mouse events" - and in there
> the mouse events all work.
> 
> Another curious fact is that for instance I right-click on a layer, and keep
> the pop-up open, and then right-click on the canvas, the popup palette
> appears. This is leading me to believe that for whatever reason when the pen
> enters the canvas realm, Krita is blocking the pen mouse events (but not the
> normal mouse).

When I leave the canvas with the mouse, no "blocking mouse events" occur. Just the leave and enter events:
 Leave            "
"[       ] Enter            "
"[       ] MouseMove        btn: 0 btns: 0 pos: 1566, 629 gpos: 1630, 746 hires:  1630.12,  745.98 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos: 1546, 668 gpos: 1610, 785 hires:  1609.55, 784.949 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos: 1521, 708 gpos: 1585, 825 hires:  1585.02, 825.078 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos: 1493, 749 gpos: 1557, 866 hires:  1556.77, 865.746 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos: 1434, 825 gpos: 1498, 942 hires:  1498.41,  942.07 Source:0"
"[       ] Leave            "
"[       ] Enter            "
"[       ] MouseMove        btn: 0 btns: 0 pos: 1059, 819 gpos: 1123, 936 hires:  1123.19, 936.313 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos: 1031, 801 gpos: 1095, 918 hires:  1095.25, 918.008 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos: 1003, 783 gpos: 1067, 900 hires:  1067.31, 899.703 Source:0"
"[       ] MouseMove        btn: 0 btns: 0 pos:  971, 765 gpos: 1035, 882 hires:  1035.07, 881.566 Source:0"
"[       ] Leave            "
Comment 12 Guz 2020-05-26 18:27:01 UTC
Created attachment 128811 [details]
Use mouse events as workaround
Comment 13 Guz 2020-05-26 18:28:23 UTC
Comment on attachment 128811 [details]
Use mouse events as workaround

Ok, I feel stupid now. This was the solution all the time.