Zulko / pianoputer

Use your computer keyboard as a "piano".
http://zulko.github.io/blog/2014/03/29/soundstretching-and-pitch-shifting-in-python/
Other
324 stars 92 forks source link

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

Open toilettenkratzer-cpu opened 3 years ago

toilettenkratzer-cpu commented 3 years ago

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 commented 3 years ago

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

toilettenkratzer-cpu commented 3 years ago

about the pianoputer.py file in the pianoputer directory

spacether commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

Sorry for this late answer

spacether commented 3 years ago

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