diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-18 18:22:15 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-18 18:22:15 +0300 |
commit | b45e566097c395f63db84bb76c935ae0850da475 (patch) | |
tree | 164b4ba5d09eb68bce02831619ea99d717e3aec6 /intern/ghost/intern/GHOST_SystemWin32.cpp | |
parent | ed7bbbe16448711042cdef0dae8125d0fddd5808 (diff) | |
parent | ccd2e89d37fb4887045969c1a50a66ca024c8c11 (diff) |
Merge branch 'master' into temp-mesh-cpp
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index e588c7485b4..83869188b65 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -872,6 +872,13 @@ GHOST_EventButton *GHOST_SystemWin32::processButtonEvent(GHOST_TEventType type, int msgPosY = GET_Y_LPARAM(msgPos); system->pushEvent(new GHOST_EventCursor( ::GetMessageTime(), GHOST_kEventCursorMove, window, msgPosX, msgPosY, td)); + + if (type == GHOST_kEventButtonDown) { + WINTAB_PRINTF("HWND %p OS button down\n", window->getHWND()); + } + else if (type == GHOST_kEventButtonUp) { + WINTAB_PRINTF("HWND %p OS button up\n", window->getHWND()); + } } window->updateMouseCapture(type == GHOST_kEventButtonDown ? MousePressed : MouseReleased); @@ -914,6 +921,8 @@ void GHOST_SystemWin32::processWintabEvent(GHOST_WindowWin32 *window) break; } case GHOST_kEventButtonDown: { + WINTAB_PRINTF("HWND %p Wintab button down", window->getHWND()); + UINT message; switch (info.button) { case GHOST_kButtonMaskLeft: @@ -939,9 +948,12 @@ void GHOST_SystemWin32::processWintabEvent(GHOST_WindowWin32 *window) /* Test for Win32/Wintab button down match. */ useWintabPos = wt->testCoordinates(msg.pt.x, msg.pt.y, info.x, info.y); if (!useWintabPos) { + WINTAB_PRINTF(" ... but associated system button mismatched position\n"); continue; } + WINTAB_PRINTF(" ... associated to system button\n"); + /* Steal the Win32 event which was previously peeked. */ PeekMessage(&msg, window->getHWND(), message, message, PM_REMOVE | PM_NOYIELD); @@ -958,9 +970,14 @@ void GHOST_SystemWin32::processWintabEvent(GHOST_WindowWin32 *window) mouseMoveHandled = true; break; } + else { + WINTAB_PRINTF(" ... but no system button\n"); + } } case GHOST_kEventButtonUp: { + WINTAB_PRINTF("HWND %p Wintab button up", window->getHWND()); if (!useWintabPos) { + WINTAB_PRINTF(" ... but Wintab position isn't trusted\n"); continue; } @@ -986,10 +1003,14 @@ void GHOST_SystemWin32::processWintabEvent(GHOST_WindowWin32 *window) if (PeekMessage(&msg, window->getHWND(), message, message, PM_REMOVE | PM_NOYIELD) && msg.message != WM_QUIT) { + WINTAB_PRINTF(" ... associated to system button\n"); window->updateMouseCapture(MouseReleased); system->pushEvent( new GHOST_EventButton(info.time, info.type, window, info.button, info.tabletData)); } + else { + WINTAB_PRINTF(" ... but no system button\n"); + } break; } default: @@ -1318,6 +1339,12 @@ void GHOST_SystemWin32::setTabletAPI(GHOST_TTabletAPI api) } } +void GHOST_SystemWin32::initDebug(GHOST_Debug debug) +{ + GHOST_System::initDebug(debug); + GHOST_Wintab::setDebug(debug.flags & GHOST_kDebugWintab); +} + void GHOST_SystemWin32::processMinMaxInfo(MINMAXINFO *minmax) { minmax->ptMinTrackSize.x = 320; @@ -1593,6 +1620,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, // Wintab events, processed //////////////////////////////////////////////////////////////////////// case WT_CSRCHANGE: { + WINTAB_PRINTF("HWND %p HCTX %p WT_CSRCHANGE\n", window->getHWND(), (void *)lParam); GHOST_Wintab *wt = window->getWintab(); if (wt) { wt->updateCursorInfo(); @@ -1601,6 +1629,20 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, break; } case WT_PROXIMITY: { + WINTAB_PRINTF("HWND %p HCTX %p WT_PROXIMITY\n", window->getHWND(), (void *)wParam); + if (LOWORD(lParam)) { + WINTAB_PRINTF(" Cursor entering context.\n"); + } + else { + WINTAB_PRINTF(" Cursor leaving context.\n"); + } + if (HIWORD(lParam)) { + WINTAB_PRINTF(" Cursor entering or leaving hardware proximity.\n"); + } + else { + WINTAB_PRINTF(" Cursor neither entering nor leaving hardware proximity.\n"); + } + GHOST_Wintab *wt = window->getWintab(); if (wt) { bool inRange = LOWORD(lParam); @@ -1616,6 +1658,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, break; } case WT_INFOCHANGE: { + WINTAB_PRINTF("HWND %p HCTX %p WT_INFOCHANGE\n", window->getHWND(), (void *)wParam); GHOST_Wintab *wt = window->getWintab(); if (wt) { wt->processInfoChange(lParam); @@ -1632,6 +1675,32 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, eventHandled = true; break; //////////////////////////////////////////////////////////////////////// + // Wintab events, debug + //////////////////////////////////////////////////////////////////////// + case WT_CTXOPEN: + WINTAB_PRINTF("HWND %p HCTX %p WT_CTXOPEN\n", window->getHWND(), (void *)wParam); + break; + case WT_CTXCLOSE: + WINTAB_PRINTF("HWND %p HCTX %p WT_CTXCLOSE\n", window->getHWND(), (void *)wParam); + break; + case WT_CTXUPDATE: + WINTAB_PRINTF("HWND %p HCTX %p WT_CTXUPDATE\n", window->getHWND(), (void *)wParam); + break; + case WT_CTXOVERLAP: + WINTAB_PRINTF("HWND %p HCTX %p WT_CTXOVERLAP", window->getHWND(), (void *)wParam); + switch (lParam) { + case CXS_DISABLED: + WINTAB_PRINTF(" CXS_DISABLED\n"); + break; + case CXS_OBSCURED: + WINTAB_PRINTF(" CXS_OBSCURED\n"); + break; + case CXS_ONTOP: + WINTAB_PRINTF(" CXS_ONTOP\n"); + break; + } + break; + //////////////////////////////////////////////////////////////////////// // Pointer events, processed //////////////////////////////////////////////////////////////////////// case WM_POINTERUPDATE: @@ -1692,6 +1761,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, break; case WM_MOUSEMOVE: if (!window->m_mousePresent) { + WINTAB_PRINTF("HWND %p mouse enter\n", window->getHWND()); TRACKMOUSEEVENT tme = {sizeof(tme)}; tme.dwFlags = TME_LEAVE; tme.hwndTrack = hwnd; @@ -1740,6 +1810,7 @@ LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, } break; case WM_MOUSELEAVE: { + WINTAB_PRINTF("HWND %p mouse leave\n", window->getHWND()); window->m_mousePresent = false; if (window->getTabletData().Active == GHOST_kTabletModeNone) { event = processCursorEvent(window); |