Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'HookManager' object has no attribute 'keyboard_hook' #11

Closed
dschiller opened this issue Jan 15, 2020 · 2 comments
Closed

Comments

@dschiller
Copy link

dschiller commented Jan 15, 2020

Code

import pyWinhook

hm = pyWinhook.HookManager()

Error

Exception ignored in: <function HookManager.__del__ at 0x00000260F1A4E558>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pyWinhook\HookManager.py", line 279, in __del__
    self.UnhookKeyboard()
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pyWinhook\HookManager.py", line 299, in UnhookKeyboard
    if self.keyboard_hook:
AttributeError: 'HookManager' object has no attribute 'keyboard_hook'
Exception ignored in: <function HookManager.__del__ at 0x00000260F1A4E558>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pyWinhook\HookManager.py", line 279, in __del__
    self.UnhookKeyboard()
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pyWinhook\HookManager.py", line 299, in UnhookKeyboard
    if self.keyboard_hook:
AttributeError: 'HookManager' object has no attribute 'keyboard_hook'
Exception ignored in: <function HookManager.__del__ at 0x00000260F1A4E558>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pyWinhook\HookManager.py", line 279, in __del__
    self.UnhookKeyboard()
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pyWinhook\HookManager.py", line 299, in UnhookKeyboard
    if self.keyboard_hook:
AttributeError: 'HookManager' object has no attribute 'keyboard_hook'

Solution

Open HookManager.py and change all key_hook words to keyboard_hook

Tungsteno74 added a commit that referenced this issue Jan 17, 2020
@Tungsteno74
Copy link
Owner

thanks for contributing :)

@Ls-Jan
Copy link

Ls-Jan commented Dec 19, 2022

Thanks. That's helpful 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants