当前位置: 首页>>代码示例>>Python>>正文


Python PyUnseen.debug方法代码示例

本文整理汇总了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
开发者ID:BackupTheBerlios,项目名称:street-svn,代码行数:54,代码来源:unseen.py


注:本文中的PyUnseen.debug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。