Page MenuHome

Fixes to T55589 and T60967 stylus pressure
Needs RevisionPublic

Authored by Christopher Peerman (chris_82) on Wed, Feb 6, 8:09 PM.

Details

Summary

This fix is aimed at the following issues:

  • T60967: Grease Pencil pressure sensitivity issue with Adesso Cyber tablet T12
  • T55589: Microsoft Surface pens does not send first events when moves

The new implementation uses WM_POINTERDOWN, WM_POINTERUP and WM_POINTERUPDATE and pointer API to process stylus events. It also changes how the pressure is reset when the Windows Ink implementation is enabled.

By processing the WM_POINTERDOWN, WM_POINTERUP and WM_POINTERUPDATE events this implementation this implementation should work on Windows 8, Windows 10 (using legacy pen interaction) and Windows 10 (using the new pen interaction), as Blender will not recieve the delays introduced by gesture recognition or whilst Windows changes the event into mouse WM_MOUSExxx or WM_xBUTTONxxx events.

The previous version reset the pressure to full when the pen left the screen, however for some hardware implementations this allowed a small window where Blender may process the final move event and read the pressure as full leaving a dot on the last event.

The destructor for GHOST_WindowWin32 also had the m_user32 being free'd off in two seperate locations. The updated implementation removes the redundant lines of code.

Diff Detail

Repository
rB Blender

Event Timeline

I don't have a windows computer and I'm not familiar with the code in question either. So I don't think I will be a good reviewer for this... :P

Brecht Van Lommel (brecht) requested changes to this revision.Tue, Feb 12, 1:57 PM

This introduces a bug for me with an old Wacom Bamboo tablet, where the first touch is always full pressure. This only happens when the tablet API is set to Automatic, Wintab works fine and Windows Ink gives no pressure.

I think we could solve this by always giving priority to Wintab if the API is there and a tablet is found. The current handling of both at the same time seems too unpredictable.

intern/ghost/intern/GHOST_SystemWin32.cpp
835

Code style convention: indent case.

intern/ghost/intern/GHOST_WindowWin32.cpp
879

Code style: { on new line.

950
warning C4715: 'GHOST_WindowWin32::getPointerInfo': not all control paths return a value
This revision now requires changes to proceed.Tue, Feb 12, 1:57 PM

Thanks I'll try update soon. I just spotted in processPointerEvent, if I added window->setTabletData(&pointerInfo.tabletData); to the GHOST_kEventButtonDown case statement it should fix the problem you're experiencing.