本文整理汇总了Python中PyUnseen.debug方法的典型用法代码示例。如果您正苦于以下问题:Python PyUnseen.debug方法的具体用法?Python PyUnseen.debug怎么用?Python PyUnseen.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyUnseen
的用法示例。
在下文中一共展示了PyUnseen.debug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gotEvent
# 需要导入模块: import PyUnseen [as 别名]
# 或者: from PyUnseen import debug [as 别名]
def gotEvent(event, wParam, lParam):
global keydown, keystate, debugEnabled
if event in mouseMsgs:
x = lParam & 0xffff
y = lParam >> 16
#print "Mouse Event: %d (%d,%d)" % (event, x, y)
mods = pyui.locals.MOD_NONE
if event in [WM_LBUTTONDOWN, WM_LBUTTONUP, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_MOUSEMOVE]:
if keystate[VK_SHIFT]:
mods |= pyui.locals.MOD_SHIFT
if keystate[VK_CONTROL]:
mods |= pyui.locals.MOD_CONTROL
if keystate[VK_MENU]:
mods |= pyui.locals.MOD_ALT
if getDesktop():
getDesktop().postUserEvent(event, x, y, wParam, mods)
return
# mods for key events
if event in [WM_CHAR, WM_KEYDOWN, WM_KEYUP]:
mods = pyui.locals.MOD_NONE
if keystate[VK_SHIFT]:
mods |= pyui.locals.MOD_SHIFT
if keystate[VK_CONTROL]:
mods |= pyui.locals.MOD_CONTROL
if keystate[VK_MENU]:
mods |= pyui.locals.MOD_ALT
# This is the handler for character keys.
if event == WM_CHAR:
getDesktop().postUserEvent(pyui.locals.CHAR, 0, 0, chr(wParam), mods)
return
if event == WM_KEYDOWN:
if debugEnabled and (DEBUG_KEY == wParam):
PyUnseen.debug(0)
return
global keydown, keystate
keystate[wParam] += 1
getDesktop().postUserEvent(pyui.locals.KEYDOWN, 0, 0, wParam, mods)
return
if event == WM_KEYUP:
global keydown, keystate
keystate[wParam] = 0
getDesktop().postUserEvent(pyui.locals.KEYUP, 0, 0, wParam, mods)
return
# special event handlers
if event == WM_CLOSE:
getDesktop().postUserEvent(pyui.locals.QUIT, 0, 0, 0)
return