Skip to content

Commit

Permalink
Incubates #6631
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelDCurran committed Jan 9, 2017
2 parents 3439000 + 0a7b024 commit 2ffe5c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/keyboardHandler.py
Expand Up @@ -180,7 +180,7 @@ def internal_keyDownEvent(vkCode,scanCode,extended,injected):
hkl=ctypes.windll.user32.GetKeyboardLayout(focus.windowThreadID)
# In previous Windows builds, calling ToUnicodeEx would destroy keyboard buffer state and therefore cause the app to not produce the right WM_CHAR message.
# However, ToUnicodeEx now can take a new flag of 0x4, which stops it from destroying keyboard state, thus allowing us to safely call it here.
res=ctypes.windll.user32.ToUnicodeEx(vkCode,scanCode,keyStates,len(charBuf),0x4,hkl)
res=ctypes.windll.user32.ToUnicodeEx(vkCode,scanCode,keyStates,charBuf,len(charBuf),0x4,hkl)
if res>0:
for ch in charBuf[:res]:
eventHandler.queueEvent("typedCharacter",focus,ch=ch)
Expand Down

0 comments on commit 2ffe5c4

Please sign in to comment.