mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
committed by
Dave Conway-Jones
parent
335c46ac06
commit
8fe2478a0b
@@ -8,6 +8,11 @@ import os
|
||||
import subprocess
|
||||
from time import sleep
|
||||
|
||||
try:
|
||||
raw_input # Python 2
|
||||
except NameError:
|
||||
raw_input = input # Python 3
|
||||
|
||||
bounce = 25;
|
||||
|
||||
if len(sys.argv) > 2:
|
||||
@@ -177,7 +182,7 @@ if len(sys.argv) > 2:
|
||||
elif cmd == "kbd": # catch keyboard button events
|
||||
try:
|
||||
while not os.path.isdir("/dev/input/by-path"):
|
||||
time.sleep(10)
|
||||
sleep(10)
|
||||
infile = subprocess.check_output("ls /dev/input/by-path/ | grep -m 1 'kbd'", shell=True).strip()
|
||||
infile_path = "/dev/input/by-path/" + infile
|
||||
EVENT_SIZE = struct.calcsize('llHHI')
|
||||
|
Reference in New Issue
Block a user