Update detectDevices.py

This commit is contained in:
chrys87 2017-02-27 17:50:07 +01:00 committed by GitHub
parent d475fdc1aa
commit 6f8c5066a3

View File

@ -1,7 +1,16 @@
#!/bin/python
iDevices = {}
def updateInputDevices():
iDeviceNo = 0
def updateInputDevices(force = False, init = False):
global iDeviceNo
if init:
iDevices = {}
iDeviceNo = 0
deviceFileList = evdev.list_devices()
if not force:
if len(deviceFileList) == iDeviceNo:
return
iDeviceNo = len(deviceFileList)
mode = 'ALL'
iDevicesFiles = []
for device in iDevices: