Explorar o código

Fix gpio input

9and3r %!s(int64=10) %!d(string=hai) anos
pai
achega
54091dcfbd
Modificáronse 1 ficheiros con 5 adicións e 5 borrados
  1. 5 5
      mopidy_touchscreen/input/gpio_inpput_manager.py

+ 5 - 5
mopidy_touchscreen/input/gpio_inpput_manager.py

@@ -46,9 +46,9 @@ def right(channel):
         type = pygame.KEYUP
     else:
         type = pygame.KEYDOWN
+        dict['unicode'] = None
     dict['key'] = pygame.K_RIGHT
     event = pygame.event.Event(type, dict)
-    event.unicode = None
     pygame.event.post(event)
 
 
@@ -58,9 +58,9 @@ def left(channel):
         type = pygame.KEYUP
     else:
         type = pygame.KEYDOWN
+        dict['unicode'] = None
     dict['key'] = pygame.K_RIGHT
     event = pygame.event.Event(type, dict)
-    event.unicode = None
     pygame.event.post(event)
 
 
@@ -70,9 +70,9 @@ def down(channel):
         type = pygame.KEYUP
     else:
         type = pygame.KEYDOWN
+        dict['unicode'] = None
     dict['key'] = pygame.K_DOWN
     event = pygame.event.Event(type, dict)
-    event.unicode = None
     pygame.event.post(event)
 
 
@@ -82,9 +82,9 @@ def up(channel):
         type = pygame.KEYUP
     else:
         type = pygame.KEYDOWN
+        dict['unicode'] = None
     dict['key'] = pygame.K_UP
     event = pygame.event.Event(type, dict)
-    event.unicode = None
     pygame.event.post(event)
 
 
@@ -94,7 +94,7 @@ def enter(channel):
         type = pygame.KEYUP
     else:
         type = pygame.KEYDOWN
+        dict['unicode'] = None
     dict['key'] = pygame.K_RETURN
     event = pygame.event.Event(type, dict)
-    event.unicode = None
     pygame.event.post(event)