From dc5fa986567f278d1793e38e455103a332b70eb4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 26 Mar 2016 17:54:04 +0000 Subject: [PATCH] #1131: add XPRA_WHEEL_DEBUG to log the win32 wheel event posted to the window's proc function git-svn-id: https://xpra.org/svn/Xpra/trunk@12230 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/platform/win32/gui.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/xpra/platform/win32/gui.py b/src/xpra/platform/win32/gui.py index 6c6b5fb869..357a0a28f4 100644 --- a/src/xpra/platform/win32/gui.py +++ b/src/xpra/platform/win32/gui.py @@ -37,6 +37,7 @@ DPI_AWARE = os.environ.get("XPRA_DPI_AWARE", "1")=="1" DPI_AWARENESS = int(os.environ.get("XPRA_DPI_AWARENESS", "1")) FORWARD_WINDOWS_KEY = os.environ.get("XPRA_FORWARD_WINDOWS_KEY", "0")=="1" +WHEEL_DEBUG = os.environ.get("XPRA_WHEEL_DEBUG", "0")=="1" KNOWN_EVENTS = {} @@ -376,6 +377,21 @@ def inputlangchange(hwnd, event, wParam, lParam): log("WM_INPUTLANGCHANGE: character set: %i, input locale identifier: %i", wParam, lParam) window.keyboard_layout_changed("WM_INPUTLANGCHANGE", wParam, lParam) win32hooks.add_window_event_handler(win32con.WM_INPUTLANGCHANGE, inputlangchange) + if WHEEL_DEBUG: + #WHEEL_DELTA = 120 + def wheel_log(event, wParam, lParam): + distance = wParam>>16 + keys = wParam & 0xFFFF + y = lParam>>16 + x = lParam & 0xFFFF + log.info("%s distance=%.1f, keys=%#x, x=%i, y=%i", event, distance, keys, x, y) + def mousewheel(hwnd, event, wParam, lParam): + wheel_log("MOUSEWHEEL", wParam, lParam) + def mousehwheel(hwnd, event, wParam, lParam): + wheel_log("MOUSEHWHEEL", wParam, lParam) + WM_MOUSEHWHEEL = 0x020E + win32hooks.add_window_event_handler(win32con.WM_MOUSEWHEEL, mousewheel) + win32hooks.add_window_event_handler(WM_MOUSEHWHEEL, mousehwheel) def remove_window_hooks(window):