Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 28th, 2005, 12:10 AM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,100
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old Jun 30th, 2005, 9:10 PM   #2
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
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
Cerulean is offline   Reply With Quote
Old Jul 1st, 2005, 5:10 PM   #3
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,100
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old Jul 1st, 2005, 5:24 PM   #4
║▓ßúdhαrlεy▓║
Newbie
 
║▓ßúdhαrlεy▓║'s Avatar
 
Join Date: Jul 2005
Location: Arizona
Posts: 19
Rep Power: 0 ║▓ßúdhαrlεy▓║ is on a distinguished road
Off Subject humor - Contra

Quote:
Originally Posted by Sane
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.
I thought it was up, down, up, down, left, right, left, right, A, B, A, B, Select, Start. Sorry I know I am new here but I couldn't resist
║▓ßúdhαrlεy▓║ is offline   Reply With Quote
Old Jul 15th, 2005, 10:13 PM   #5
hamstu
Newbie
 
Join Date: Jul 2005
Posts: 2
Rep Power: 0 hamstu is on a distinguished road
Did you check the docs?
http://www.pygame.org/docs/ref/pygame_event.html#clear
That might be useful.
hamstu is offline   Reply With Quote
Old Jul 17th, 2005, 8:20 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,100
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
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.
Sane is offline   Reply With Quote
Old Jul 19th, 2005, 2:45 AM   #7
Minion
Newbie
 
Minion's Avatar
 
Join Date: Jul 2005
Posts: 3
Rep Power: 0 Minion is on a distinguished road
Quote:
Originally Posted by ║▓ßúdhαrlεy▓║
I thought it was up, down, up, down, left, right, left, right, A, B, A, B, Select, Start. Sorry I know I am new here but I couldn't resist
You are wrong. It's up, up, down, down, left, right, left, right, B, A, Start.
Perhaps...

Nevermind, I don't quite know what I'm talking about. Creating the empty would be all I could have done.
Minion is offline   Reply With Quote
Old Jul 19th, 2005, 5:04 PM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I could swear it was Up, Down, Left, Right, A, B, C, Start...
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC