[Bf-blender-cvs] [f880fe2d66f] master: Fix T82288 Wintab walk navigation erratic.

Nicholas Rishel noreply at git.blender.org
Fri Dec 18 02:22:11 CET 2020


Commit: f880fe2d66f1975880c21401246a5ff48f479314
Author: Nicholas Rishel
Date:   Thu Dec 17 17:19:54 2020 -0800
Branches: master
https://developer.blender.org/rBf880fe2d66f1975880c21401246a5ff48f479314

Fix T82288 Wintab walk navigation erratic.

Walk navigation relies on tablet data being set to detect if motion is
absolute. This patch sets tablet data in Ghost to dummy values when a
tablet pen is in range and not handled by Wintab processing.

===================================================================

M	intern/ghost/intern/GHOST_SystemWin32.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 2bf1d0c2d35..7e800619dda 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -1151,6 +1151,8 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind
   GHOST_TInt32 x_screen, y_screen;
   GHOST_SystemWin32 *system = (GHOST_SystemWin32 *)getSystem();
 
+  GHOST_TabletData tabletData = GHOST_TABLET_DATA_NONE;
+
   if (window->m_tabletInRange || window->wintabSysButPressed()) {
     if (window->useTabletAPI(GHOST_kTabletWintab) &&
         processWintabEvent(
@@ -1164,8 +1166,13 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind
       return NULL;
     }
 
-    /* If using Wintab but no button event is currently active,
-     * fall through to default handling. */
+    /* If using Wintab but no button event is currently active, fall through to default handling.
+     *
+     * Populate tablet data so that cursor is recognized as an absolute position device. */
+    tabletData.Active = GHOST_kTabletModeStylus;
+    tabletData.Pressure = 0.0f;
+    tabletData.Xtilt = 0.0f;
+    tabletData.Ytilt = 0.0f;
   }
 
   system->getCursorPosition(x_screen, y_screen);
@@ -1198,16 +1205,12 @@ GHOST_EventCursor *GHOST_SystemWin32::processCursorEvent(GHOST_WindowWin32 *wind
                                    window,
                                    x_screen + x_accum,
                                    y_screen + y_accum,
-                                   GHOST_TABLET_DATA_NONE);
+                                   tabletData);
     }
   }
   else {
-    return new GHOST_EventCursor(system->getMilliSeconds(),
-                                 GHOST_kEventCursorMove,
-                                 window,
-                                 x_screen,
-                                 y_screen,
-                                 GHOST_TABLET_DATA_NONE);
+    return new GHOST_EventCursor(
+        system->getMilliSeconds(), GHOST_kEventCursorMove, window, x_screen, y_screen, tabletData);
   }
   return NULL;
 }



More information about the Bf-blender-cvs mailing list