forked from home-assistant/core
Pykeyboard won't import PyHook now when not needed.
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
from ctypes import *
|
from ctypes import *
|
||||||
import win32api
|
import win32api
|
||||||
from win32con import *
|
from win32con import *
|
||||||
import pythoncom, pyHook
|
import pythoncom
|
||||||
|
|
||||||
from .base import PyKeyboardMeta, PyKeyboardEventMeta
|
from .base import PyKeyboardMeta, PyKeyboardEventMeta
|
||||||
|
|
||||||
@@ -224,6 +224,8 @@ class PyKeyboardEvent(PyKeyboardEventMeta):
|
|||||||
to listen for keyboard input.
|
to listen for keyboard input.
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
import pyHook
|
||||||
|
|
||||||
PyKeyboardEventMeta.__init__(self)
|
PyKeyboardEventMeta.__init__(self)
|
||||||
self.hm = pyHook.HookManager()
|
self.hm = pyHook.HookManager()
|
||||||
self.shift_state = 0 # 0 is off, 1 is on
|
self.shift_state = 0 # 0 is off, 1 is on
|
||||||
|
Reference in New Issue
Block a user