=== modified file 'source/NVDAHelper.py' --- source/NVDAHelper.py 2010-02-14 05:37:44 +0000 +++ source/NVDAHelper.py 2010-02-15 17:23:37 +0000 @@ -11,7 +11,6 @@ import api import globalVars from logHandler import log -import time import globalVars EVENT_TYPEDCHARACTER=0X1000 @@ -20,7 +19,6 @@ _remoteLoader64=None localLib=None generateBeep=None -lastKeyboardLayoutChangeEventTime=None winEventHookID=None @@ -85,7 +83,6 @@ @winUser.WINEVENTPROC def winEventCallback(handle,eventID,window,objectID,childID,threadID,timestamp): - global lastKeyboardLayoutChangeEventTime try: if eventID==EVENT_TYPEDCHARACTER: handleTypedCharacter(window,objectID,childID) === modified file 'source/NVDAHelper/remote/inputLangChange.cpp' --- source/NVDAHelper/remote/inputLangChange.cpp 2010-02-13 10:53:50 +0000 +++ source/NVDAHelper/remote/inputLangChange.cpp 2010-02-15 17:46:24 +0000 @@ -10,13 +10,16 @@ LRESULT CALLBACK inputLangChange_callWndProcHook(int code, WPARAM wParam, LPARAM lParam) { static int lastInputLangChange=0; + static unsigned lastInputLangChangeTime=0; + static wchar_t buf[KL_NAMELENGTH ]; CWPSTRUCT* pcwp=(CWPSTRUCT*)lParam; - if((pcwp->message==WM_INPUTLANGCHANGE)&&(pcwp->lParam!=lastInputLangChange)) { - wchar_t* buf=(wchar_t*)malloc(sizeof(wchar_t)*1024); - GetKeyboardLayoutName(buf); - nvdaController_inputLangChangeNotify(GetCurrentThreadId(),pcwp->lParam,buf); - free(buf); - lastInputLangChange=pcwp->lParam; + if((pcwp->message==WM_INPUTLANGCHANGE)) { + if ((pcwp->lParam!=lastInputLangChange) && (GetTickCount()-lastInputLangChangeTime>100)) { + GetKeyboardLayoutName(buf); + nvdaController_inputLangChangeNotify(GetCurrentThreadId(),pcwp->lParam,buf); + lastInputLangChange=pcwp->lParam; + } + lastInputLangChangeTime=GetTickCount(); } return 0; }