-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.py
More file actions
19 lines (13 loc) · 727 Bytes
/
debug.py
File metadata and controls
19 lines (13 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from windows import *
from wtl import *
class MsgFormatter:
RMSGS = dict([(x, y) for (y, x) in MSGS]) #reverse msg dict for debugging
def formatMouseMove(self, wParam, lParam):
return "wParam: %d, lParam: %d, x: %d, y: %d" % ((wParam, lParam) + GET_XY_LPARAM(lParam))
def formatDefault(self,blaat, wParam, lParam):
return "wParam: %d, lParam: %d" % (wParam, lParam)
formatters = {WM_MOUSEMOVE: formatMouseMove,
WM_LBUTTONDOWN: formatMouseMove}
def format(self, nMsg, wParam, lParam):
return "%s %s" % (self.RMSGS.get(nMsg, nMsg),
self.formatters.get(nMsg, self.formatDefault)(self, wParam, lParam))