Fix T51948: pen pressure not detected with some Wacom tablets.
authorJames Fulop <Yam>
Mon, 24 Jul 2017 11:32:16 +0000 (13:32 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 24 Jul 2017 11:54:36 +0000 (13:54 +0200)
Generalizes current conditions, QT implements it the same way.

intern/ghost/intern/GHOST_WindowWin32.cpp

index fc46164c1357a071dd6c79bf7f3846a84b6cee68..7ac54e5c91514f540e72bd94b595e89958d40ed0 100644 (file)
@@ -890,19 +890,14 @@ void GHOST_WindowWin32::processWin32TabletEvent(WPARAM wParam, LPARAM lParam)
                if (fpWTPacket) {
                        if (fpWTPacket((HCTX)lParam, wParam, &pkt)) {
                                if (m_tabletData) {
-                                       switch (pkt.pkCursor) {
-                                               case 0: /* first device */
-                                               case 3: /* second device */
+                                       switch (pkt.pkCursor % 3) { /* % 3 for multiple devices ("DualTrack") */
+                                               case 0:
                                                        m_tabletData->Active = GHOST_kTabletModeNone; /* puck - not yet supported */
                                                        break;
                                                case 1:
-                                               case 4:
-                                               case 7:
                                                        m_tabletData->Active = GHOST_kTabletModeStylus; /* stylus */
                                                        break;
                                                case 2:
-                                               case 5:
-                                               case 8:
                                                        m_tabletData->Active = GHOST_kTabletModeEraser; /* eraser */
                                                        break;
                                        }