Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Event' object has no attribute 'key' #24

Open
toilettenkratzer-cpu opened this issue Jan 29, 2021 · 6 comments
Open

AttributeError: 'Event' object has no attribute 'key' #24

toilettenkratzer-cpu opened this issue Jan 29, 2021 · 6 comments

Comments

@toilettenkratzer-cpu
Copy link

I've found this error and I did fix it.
I put the lines 293-296 key = keyboard.get ... in before the line 291 elif event.key ...
the error is that you called the function before you defined it. Hope that helped.

@spacether
Copy link
Collaborator

spacether commented Feb 16, 2021

Hey there @toilettenkratzer-cpu. Thank you for reporting this. Which file are you writing about?

@toilettenkratzer-cpu
Copy link
Author

about the pianoputer.py file in the pianoputer directory

@spacether
Copy link
Collaborator

spacether commented Feb 25, 2021

So our code only allows in quit events and key events so after we handle the quit event, all events should be key events.
So a pygame event's key should exist.

  1. What version of python are you using?
  2. What version of pygame?
  3. What version of pianoputer?
  4. What operating system are you using?
  5. Can you paste in your stack trace error message?
  6. Can you print the event so we see what kind of event is causing this problem?

I am unable to reproduce this. With your info from questions 1-6 I can figure out what is causing this issue.
Thanks!

@toilettenkratzer-cpu
Copy link
Author

Python 3.9
Pygame 1.9.6
Pianoputer v 2.0.2
Debian 10
The error massage is the headline
The error event is the key.event event

@toilettenkratzer-cpu
Copy link
Author

Sorry for this late answer

@spacether
Copy link
Collaborator

spacether commented Mar 6, 2021

Hm that implies that pygame set_allowed is not working correctly on your system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants