Update inputDriver.py
This commit is contained in:
parent
2f173182e8
commit
3e8a53aa56
@ -15,15 +15,11 @@ class inputDriver():
|
|||||||
self._isInitialized = True
|
self._isInitialized = True
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
if self._initialized:
|
if self._initialized:
|
||||||
self.releaseDevices()
|
self.removeAllDevices()
|
||||||
self._isInitialized = False
|
self._isInitialized = False
|
||||||
def getInputEvent(self):
|
def getInputEvent(self):
|
||||||
time.sleep(0.05)
|
time.sleep(0.1)
|
||||||
return None
|
return None
|
||||||
def handleInputEvent(self, event):
|
|
||||||
time.sleep(0.05)
|
|
||||||
if not self._initialized:
|
|
||||||
return
|
|
||||||
def writeEventBuffer(self):
|
def writeEventBuffer(self):
|
||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
return
|
return
|
||||||
@ -31,7 +27,7 @@ class inputDriver():
|
|||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
return
|
return
|
||||||
del self.env['input']['eventBuffer'][:]
|
del self.env['input']['eventBuffer'][:]
|
||||||
def updateInputDevices(self, force = False, init = False):
|
def updateInputDevices(self, newDevices = None, init = False)
|
||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
return
|
return
|
||||||
def getLedState(self, led = 0):
|
def getLedState(self, led = 0):
|
||||||
@ -47,10 +43,17 @@ class inputDriver():
|
|||||||
def ungrabAllDevices(self):
|
def ungrabAllDevices(self):
|
||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
return
|
return
|
||||||
|
def hasIDevices(self):
|
||||||
|
if not self._initialized:
|
||||||
|
return False
|
||||||
|
return False
|
||||||
def removeAllDevices(self):
|
def removeAllDevices(self):
|
||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
return
|
return
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
return
|
return
|
||||||
|
try:
|
||||||
self.removeAllDevices()
|
self.removeAllDevices()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user