I'm making a python app that triggers an action when the print screen key is pressed. I'm using pyhook library. However, every time I press a character written with the language of my country (ãíé and others) is doubling the characters . For example : ~~a ''e ''i , causing problems in the normal user written use. Is there any way to fix ?
Asked
Active
Viewed 225 times
0
-
And what is the question? – Clodion Feb 07 '16 at 22:30
-
1So you react to the print screen button, what does that have to do with other characters? – Fredrik Feb 07 '16 at 22:36
-
pyhook is monitoring key events. – user3553966 Feb 07 '16 at 23:05
2 Answers
0
Suggested method: use pygame
module instead of pythoncom
for pump events
hooks_manager = pyHook.HookManager()
hooks_manager.KeyDown = OnKeyboardEvent
hooks_manager.HookKeyboard()
# Dont use pythoncom.PumpMessages()
pygame.init()
while True:
pygame.event.pump()
Old method: try to change preferred language and switch it back (just toggle), it may help.
For ex:
- Add one more language pack (not keyboard layout, input type same)
- Change preferred language
- Switch back to old one (that you are using)
- Switch back again if doesn't work

marc_s
- 732,580
- 175
- 1,330
- 1,459

yEmreAk.com
- 3,278
- 2
- 18
- 37