boppreh / keyboard

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

Issue with basic use case (missing dependency?) #569

Open eopenshaw-vizio opened 1 year ago

eopenshaw-vizio commented 1 year ago

Hi,

This library looks like just what i need, but I'm running into an issue pretty much right out of the gate. About my env:

My code simply consists of:

import keyboard
keyboard.wait('d')

and i'm getting:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.9/dist-packages/keyboard/_nixcommon.py", line 106, in start_reading
    self.event_queue.put(device.read_event())
  File "/usr/local/lib/python3.9/dist-packages/keyboard/_nixcommon.py", line 83, in read_event
    data = self.input_file.read(struct.calcsize(event_bin_format))
AttributeError: 'NoneType' object has no attribute 'read'

I feel like i must be missing something fundamental in my environment. Any help appreciated!!

Thanks

eopenshaw-vizio commented 1 year ago

I just noticed #567, i have the same issue running on my host... curious if there is a related issue carrying over into my container (which is running an arm64 image)