OSDN Git Service

winConsoleHandler.consoleWinEventHook(): Only fetch console screen buffer info if...
authorJames Teh <jamie@jantrid.net>
Tue, 9 Nov 2010 10:53:42 +0000 (20:53 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 9 Nov 2010 10:53:42 +0000 (20:53 +1000)
source/winConsoleHandler.py

index 1343119..b9a052f 100755 (executable)
@@ -95,13 +95,13 @@ def consoleWinEventHook(handle,eventID,window,objectID,childID,threadID,timestam
                return\r
        if eventID==winUser.EVENT_CONSOLE_CARET:\r
                eventHandler.queueEvent("caret",consoleObject)\r
-       consoleScreenBufferInfo=wincon.GetConsoleScreenBufferInfo(consoleOutputHandle)\r
        # It is safe to call this event from this RPC thread.\r
        # This avoids an extra core cycle.\r
        consoleObject.event_textChange()\r
        if eventID==winUser.EVENT_CONSOLE_UPDATE_SIMPLE:\r
                x=winUser.LOWORD(objectID)\r
                y=winUser.HIWORD(objectID)\r
+               consoleScreenBufferInfo=wincon.GetConsoleScreenBufferInfo(consoleOutputHandle)\r
                if x<consoleScreenBufferInfo.dwCursorPosition.x and (y==consoleScreenBufferInfo.dwCursorPosition.y or y==consoleScreenBufferInfo.dwCursorPosition.y+1):  \r
                        queueHandler.queueFunction(queueHandler.eventQueue,speech.speakTypedCharacters,unichr(winUser.LOWORD(childID)))\r
 \r