Skip to content

Commit c3c0848

Browse files
committed
Compatibility to 64bit version
1 parent cd8ace9 commit c3c0848

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pyPadPlusPlus/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
def GetCursorPos():
2828
point = (c_ulong*2)()
2929
windll.user32.GetCursorPos(byref(point))
30-
return point
30+
return [int(i) for i in point]
3131
def GetWindowRect(hwnd):
3232
rect = (c_ulong*4)()
3333
windll.user32.GetWindowRect(hwnd, byref(rect))
34-
return rect
34+
return [int(i) for i in rect]
3535

3636
init_matplotlib_EventHandler = """try:
3737
import matplotlib
@@ -177,8 +177,8 @@ def onBufferActivated(self, args):
177177

178178
def onTimer(self):
179179
self.timerCount += 1
180-
middleButton = GetKeyState(VK_MBUTTON)
181-
if middleButton < 0 and self.middleButton >= 0:
180+
middleButton = GetKeyState(VK_MBUTTON) & (-127 + 32768) > 1
181+
if middleButton:
182182
x,y = GetCursorPos()
183183
hwnd = WindowFromPoint(x,y)
184184
x0,y0,x1,y1 = GetWindowRect(hwnd)

0 commit comments

Comments
 (0)