Skip to content

Commit

Permalink
#1131: add XPRA_WHEEL_DEBUG to log the win32 wheel event posted to th…
Browse files Browse the repository at this point in the history
…e window's proc function

git-svn-id: https://xpra.org/svn/Xpra/trunk@12230 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Mar 26, 2016
1 parent 8b23823 commit dc5fa98
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/xpra/platform/win32/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit dc5fa98

Please sign in to comment.