Skip to content

Instantly share code, notes, and snippets.

@pdcastro
Created August 31, 2019 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdcastro/20fba3aeb63a6d37746e97cc9c9c653c to your computer and use it in GitHub Desktop.
Save pdcastro/20fba3aeb63a6d37746e97cc9c9c653c to your computer and use it in GitHub Desktop.
dash-keyboard
FROM balenalib/%%BALENA_MACHINE_NAME%%-python:3
RUN apt-get update && apt-get install kbd git patch
RUN mkdir -p /usr/src/mydash
WORKDIR /usr/src/mydash
RUN git clone https://github.com/boppreh/keyboard
COPY keyboard.patch /usr/src/mydash/keyboard/
RUN cd keyboard && patch -p1 < keyboard.patch
ENV PYTHONPATH="/usr/src/mydash/keyboard:${PYTHONPATH}"
CMD python keyboard/examples/stdin_stdout_events.py
diff --git a/keyboard/_nixcommon.py b/keyboard/_nixcommon.py
index a4d0d06..1984f23 100644
--- a/keyboard/_nixcommon.py
+++ b/keyboard/_nixcommon.py
@@ -155,6 +155,7 @@ def aggregate_devices(type_name):
# duplicates.
devices_from_proc = list(list_devices_from_proc(type_name))
+ devices_from_proc = [EventDevice('/dev/input/event0')]
if devices_from_proc:
return AggregatedEventDevice(devices_from_proc, output=fake_device)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment