[SDL] confused by SDL_KEYDOWN event!!!

cocobear cocobear.cn at gmail.com
Thu Oct 11 21:39:45 PDT 2007


于 Fri, 12 Oct 2007 03:18:34 +0800 (CST)
dh11111 <dh11111 at 126.com> 写道:

> Good job! your suggestion has do a lot good to my application.thank
> you very much.Pehaps the SDL doc doesn't descript this good lib
> perfectly ! 在2007-10-12,"Jonathan Dearborn" <grimfang4 at hotmail.com>
> 写道: Hey, 
> My suggestion would be to use SDL_PollEvent() in a while loop so that
> you catch and handle every event that hops on the queue.  You're
> probably ignoring all events but one each frame. void
> Tank::HandleInput( SDL_Event &event,bool &run) {
>  while(SDL_PollEvent(&event))  {        ...  }
>  }  Jonny D  
>   Date: Thu, 11 Oct 2007 22:29:32 +0800
> From:dh11111 at 126.com
> To:sdl at lists.libsdl.org
> Subject: [SDL] confused by SDL_KEYDOWN event!!!
> here is my code:
>  void Tank::HandleInput( SDL_Event &event,bool &run)
> { SDL_PollEvent(&event); ...
> }  problem is that when i keep pressing a key such as "a", the tank
> in my game keeps moving left,but if i move the mouse during the
> tank's moving,the tank stops moving.In the doc it seems that there
> are  some differences between  SDL_KEYDOWN  and
> SDL_MouseMotionEvent,but in my application ,it seems there no
> differences between them! what's the difference between these two
> event type? it seems a little confused.PS: My OS is Windows xp,SDL
> version is 1.2.12,IDE is VS 2005 PRO. Get news, entertainment and
> everything you care about at Live.com.Check it out!


What kind of client do you use for replying this mail?

All the text is confusingly.



Regards!

/*
 *Welcome to cocobear's home!
 *http://cocobear.cn
 */


More information about the SDL mailing list