Oddities with the WinInk API and side buttons when using a Wacom Intuos pen tablet
Open, Needs TriagePublic

Description

TL;DR

This report is meant to simply put on record findings and discussions about the issue made on IRC, as its origin appears to have been singled out to the WinInk API not supporting more than one side button per stylus.

Primary issue

I have a Wacom Intuos 5 Touch tablet on Windows 10 64bit (1809) with the latest drivers (6.3.33-3). I noticed that with the experimental WinInk API on Krita 4.1.7 on Windows, as well as more recent nightly builds (g5ec151653f tested), by setting what otherwise would normally be "Middle click" button on the stylus (which doesn't work with the WinInk API) to "Pan/Zoom" in the Wacom control panel, it works exactly as if it was MMB with the WinTab API.

Using the WinInk API, MMB on the stylus never worked for me also on earlier Krita windows versions, which meant that I had to use different methods for panning, and so on.

My primary reason for using the WinInk API is that with WinTab if I enable a second screen while Krita is opened, the tablet mapping on the canvas gets disrupted while this does not happen with WinInk.

While in Krita Spacebar can act as a replacement for MMB, it works differently than MMB panning. With the former I have to press, then click-drag with the pen tip. With the latter, panning begins as soon as the button is pressed. I tried setting up other shortcuts to reproduce the same behavior with MMB, but so far I couldn't manage to. Thus, that was the only drawback (for me) of using the WinInk API. Now for my uses it's equivalent to the WinTab API, with the difference that it handles changing the display configuration.

With the "Pan/zoom" button setting, other Krita shortcuts normally associated with MMB like rotating and zooming also work, so for all intents and purposes it is acting as a MMB now, while with "Middle Mouse" it does not seem to work at all. Again, this is with WinInk. With WinTab, "Middle Mouse" works correctly.

Tablet log

I was asked to provide a tablet log using DebugView from Sysinternals. What I did was clicking on the Krita title bar, then pressing the side button and hovering the stylus on the canvas for a while.

Other tests

  • Upon request I tried disabling the Spacebar+LMB input for "Pan Canvas" in Krita's canvas input settings to if it would still work like that. As a result panning didn't work anymore, but I could still hold Shift for canvas rotation or Control for canvas zooming. Keeping the button pressed paints on the canvas while hovering the stylus.
  • By holding the button, then click-dragging, the canvas gets zoomed in/out slowly (choppily) regardless of whether the Spacebar+LMB shortcut enabled
  • By disabling one of the side buttons and setting the other to LMB, canvas panning works albeit not entirely correctly (the button doesn't get released in the software).
    • This appears to be consistent with the WinInk API not supporting more than one side button on the stylus (also see below).

Developer comments

Dmitry Kazakov pointed out that WinInk doesn't support reporting more than one button in the stylus barrel and that it is likely that setting the button to "pan" just generates keyboard Spacebar key, depending on how the Wacom driver maps the buttons.

Upon analysis of the previously provided logs, Dmitry could confirm that "Pan/Zoom" generates Spacebar+LMB, while "Middle Click" generates no tablet press events, only synthesized mouse events.

Discussion

If WinInk can only support one side button on the stylus, then that's the likely reason why it doesn't work as per initial observations. Normally (at least when using WinTab) I have the side buttons set up to RMB (top) and MMB (bottom). Wacom Driver defaults for this are "Double click" and RMB.

neviril created this task.Apr 1 2019, 6:12 PM

Let's add some devs as subscribers to this :)

Hi, @neviril!

Could you please test the very latest nightly build with WinTab setting? I've implemented auto-update of the desktop resolution. It should kind of work now.

PS: and about winink, I'm investigating now

I can confirm, Windows Pointer API doesn't support more than one (right) button. Just by-design. Theoretically, drivers might try to add a hack to report more (and breaking the protocol), but none of the drivers I tested do that. So I'm not sure what we can discuss here :)

@dkazakov
I have just tried the latest build 17f2c8d and the WinTab setting as suggested. From a single display condition and Krita already started, after enabling a second display (Win+P, "Extend", to the right of the primary display) the canvas appears to maintain the correct tablet mapping, but from an extended desktop to a single display again ("PC Screen Only"), tablet-canvas mapping does not return to normal. In other words, this seems to work correctly only once, but it's already an improvement.

Pity about the Windows Pointer API, but I guess that was expected in the end, given the previously acknowledged API limitations. Upon external suggestion, this task was mostly meant to put into a more permanent form the discussion made on IRC on the subject.