Skip to content

Commit

Permalink
Fix: Attribute Error on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Sep 2, 2019
1 parent 004c982 commit 3e9c523
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spygame/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def tick(self):
events = pygame.event.get([pygame.KEYDOWN, pygame.KEYUP])
for e in events:
# a key was pressed that we are interested in -> set to True or False
if e.key in self.keyboard_registry:
if getattr(e, 'key', None) in self.keyboard_registry:
if e.type == pygame.KEYDOWN:
self.keyboard_registry[e.key] = True
self.trigger_event("key_down." + self.descriptions[e.key])
Expand Down

0 comments on commit 3e9c523

Please sign in to comment.