mirror of
https://github.com/marcriera/ddgo-converter.git
synced 2025-04-11 07:29:28 +02:00
Error handling for grab/ungrab
This commit is contained in:
parent
07dd9abfa2
commit
cbfe1d366d
1 changed files with 8 additions and 2 deletions
|
@ -52,10 +52,16 @@ class SwitchGamepad(PhysicalGamepad):
|
|||
self.device = self._get_device()
|
||||
|
||||
def start(self):
|
||||
self.device.grab()
|
||||
try:
|
||||
self.device.grab()
|
||||
except:
|
||||
return
|
||||
|
||||
def stop(self):
|
||||
self.device.ungrab()
|
||||
try:
|
||||
self.device.ungrab()
|
||||
except:
|
||||
return
|
||||
|
||||
def read_input(self):
|
||||
# time.sleep(5)
|
||||
|
|
Loading…
Add table
Reference in a new issue