![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() ![]() |
Pygame Key Input
How can I clear the que of buttons pressed, so not to accidently hit enter for something that the user hasn't even seen yet?
I'm using: for event in pygame.event.get():
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges! Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download. |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
The queue of buttons pressed? You may have to re-phrase that, or provide more detail into what kind of button you're talking about here
![]() |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() |
If you press (up left up left down right down) it'll que all those buttons in to pygame.event . Then when in the loop it reaches 'for event in pygame.event.get()' it takes all the buttons that were pressed and executes accordingly in the for loop. I want a way so at any time I want, anywhere, I can destroy all the buttons that were already pressed. I tried running an empty for event in pygame.event.get() but, all it did was keep the buttons.
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges! Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download. |
|
|
|
|
|
#4 | |
|
Newbie
Join Date: Jul 2005
Location: Arizona
Posts: 19
Rep Power: 0
![]() |
Off Subject humor - Contra
Quote:
|
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Jul 2005
Posts: 2
Rep Power: 0
![]() |
Did you check the docs?
http://www.pygame.org/docs/ref/pygame_event.html#clear That might be useful. |
|
|
|
|
|
#6 |
|
Programming Guru
![]() ![]() |
Oh sorry, I should have came back to this topic. I figured it out. Just simply:
for event in pygame.event.get():"void"
__________________
Looking for tough programming challenges? Try participating in Sane's Monthly Algorithms Challenges! Composing Techno is a little side hobby of mine. Techno by DJ Sane. All free for download. |
|
|
|
|
|
#7 | |
|
Newbie
Join Date: Jul 2005
Posts: 3
Rep Power: 0
![]() |
Quote:
Perhaps... Nevermind, I don't quite know what I'm talking about. Creating the empty would be all I could have done. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|