mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Pykeyboard won't import PyHook now when not needed.
This commit is contained in:
parent
866a3e852e
commit
6de531db0d
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user