3 Hello Mouse? An Example of the New Event Code
6 <div style="text-align: right;"><i>Any code that is not marketed is dead code <br />
9 You need the new code from the <b> <a href="http://http://github.com/kthakore/SDL_Perl/tree/redesign">redesign branch</a></b> to use this . <br />
11 <pre class="fake-gist" id="fake-gist-231987">#!/usr/bin/env perl
18 SDL::init(SDL_INIT_VIDEO);
20 my $display = SDL::Video::set_video_mode(640,480,32, SDL_SWSURFACE );
21 my $event = SDL::Event->new();
25 SDL::Events::pump_events();
27 if(SDL::Events::poll_event($event) && $event->type == SDL_ACTIVEEVENT)
29 print "Hello Mouse!!!\n" if ($event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
30 print "Bye Mouse!!!\n" if (!$event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
33 exit if($event->type == SDL_QUIT);
34 }</pre><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3102167581424744259-4268622242266513664?l=yapgh.blogspot.com' alt='' /></div>
35 <p><a href="http://feedads.g.doubleclick.net/~a/VcCMh0XKi92JWmYoQnOB3cQLHtY/0/da"><img src="http://feedads.g.doubleclick.net/~a/VcCMh0XKi92JWmYoQnOB3cQLHtY/0/di" border="0" ismap="true"></img></a><br/>
36 <a href="http://feedads.g.doubleclick.net/~a/VcCMh0XKi92JWmYoQnOB3cQLHtY/1/da"><img src="http://feedads.g.doubleclick.net/~a/VcCMh0XKi92JWmYoQnOB3cQLHtY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/YetAnotherPerlGameHackeryapgh/~4/xhzWiodiKJI" height="1" width="1"/></div></div>