boppreh / keyboard

Hook and simulate global keyboard events on Windows and Linux.
MIT License
3.76k stars 433 forks source link

Getting an error while using `from keyboard import mouse` in `macOS` #586

Open prashanshajain opened 1 year ago

prashanshajain commented 1 year ago
Exception in thread Thread-2 (run):
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/zxff/Documents/tracker/python-scripts/.venv/lib/python3.10/site-packages/keyboard/_darwinmouse.py", line 53, in run
    Quartz.CFRunLoopRunInMode(Quartz.kCFRunLoopDefaultMode, 5, False)
  File "/Users/zxff/Documents/tracker/python-scripts/.venv/lib/python3.10/site-packages/keyboard/_darwinmouse.py", line 58, in handler
    key_name = name_from_scancode(scan_code)
NameError: name 'name_from_scancode' is not defined