Hello,
Using Windows 8 x64, Python 2.7 x64 and pyHook 1.5.1 x64 (found here, "Base distribution" : http://www.lfd.uci.edu/~gohlke/pythonlibs/ )
I am encountering some problems with pyHook using a french AZERTY keyboard. It seems that I can't properly use '^' accents when pyHook is running.
def on_key_down(event):
print event.Key
import pyHook
hook_manager = pyHook.HookManager()
hook_manager.KeyDown = on_key_down
hook_manager.HookKeyboard()
import pygtk
pygtk.require('2.0')
import gtk
gtk.main()
==========
If I launch this script, when I press this on my keyboard : '^' - 'a' - '^' - 'a' - '^' - 'a'
The script prints this :
=============
Oem_6
A
Oem_6
A
Oem_6
A
=============
And it writes this in an opened notepad window : ^^a^^a^^a
But it should print : âââ
It would be nice if pyHook didn't forbid me to write 'â' :).
Thanks for your work on pyHook btw.
I confirm having the exact same problem.
Anyway to work around it? (and thanks for Pyhook :) )
Hi,
It also happens with spanish accents isntead of 'á' it is writting '´´a'.
I propose myself to correct this bug, I just need a hint for where to start, because I am not familiar with pyhook source code.
Hi, I found this bug today. I also have non-english keyboard, czech keyboard concretely. I am unable to write chars like é, ě, ü, etc. All I get is doubled accents and diacritics. So I spent rest of the day to find out why and I may have a solution.
First I found this thread:
http://www.experts-exchange.com/Programming/Microsoft_Development/Q_23453780.html
With proposed enhancement I was able to write non-Shift chars like é, ö, but not chars ě (needs hold shift key).
Finally I found this post:
http://stackoverflow.com/questions/1964614/toascii-tounicode-in-a-keyboard-hook-destroys-dead-keys
I've tried to implement ToUnicode (somehow) and it works. But I am not C++ programmer at all, lowlevel win32 programming is nightmare for me, but I hope it will work.
Here is attached .zip file with modified cpyHook.i file. Please, feel free to try this and let us know, if it works on yout keyboard too. Thanks
Hi, i can't understand. Please give me more details Milan Herbig
Hi, what is it you can't understand. It's a long time a struggled with this. I actually left a pyhook implementation and used pure Python implementation using ctypes and user32.dll library. You can find my hook for global keyboard shortcuts listening here
https://github.com/m1lhaus/woofer/blob/master/components/winkeyhook.py