SDL::Event man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

SDL::Event(3)	      User Contributed Perl Documentation	 SDL::Event(3)

NAME
       SDL::Event - a SDL perl extension

SYNOPSIS
	use SDL::Event;
	my $event = new SDL::Event;		# create a new event
	$event->pump();				# pump all events from SDL Event Queue
	$event->poll();				# Get the top one from the queue
	while ($event->wait()) {
	       my $type = $event->type();      # get event type
	       # ... handle event
	       exit if $type == SDL_QUIT;
	}

DESCRIPTION
       "SDL::Event" offers an object-oriented approach to SDL events. By
       creating an instance of SDL::Event via new() you can wait for events,
       and then determine the type of the event and take an appropriate
       action.

EXAMPLE
       Here is an example of a simple event handler loop routine.  See also
       SDL::App::loop.

	      sub loop {
		      my ($self,$href) = @_;
		      my $event = new SDL::Event;
		      while ( $event->wait() ) {
			      # ... insert here your event handling like:
			      if ( ref($$href{$event->type()}) eq "CODE" ) {
				      &{$$href{$event->type()}}($event);
				      $self->sync();
			      }
		      }
	      }

METHODS
   new()
       Create a new event object.

   type()
       Returns the type of the event, see list of exported symbols for which
       are available.

   pump()
   poll()
   wait()
       Waits for an event end returns then. Always returns true.

   set( type, state )
       Set the state for all events of the given event's type

   set_unicode( toggle )
       Toggle unicode on the event.

   set_key_repeat( delay, interval)
       Sets the delay and intervall of the key repeat rate (e.g. when a user
       holds down a key on the keyboard).

   active_gain()
   active_state()
   key_state()
   key_sym()
   key_name()
   key_mod()
   key_unicode()
   key_scancode()
   motion_state()
   motion_x()
       Returns the motion of the mouse in X direction as an absolute value.

   motion_y()
       Returns the motion of the mouse in Y direction as an absolute value.

   motion_xrel()
       Returns the motion of the mouse in X direction as a relative value.

   motion_yrel()
       Returns the motion of the mouse in Y direction as a relative value.

   button_state()
       Returns the state of the mouse buttons.

   button_x()
   button_y()
   button()
AUTHOR
       David J. Goehrig Documentation by Tels <http://bloodgate.com/>

SEE ALSO
       perl SDL::App

perl v5.14.1			  2011-07-18			 SDL::Event(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net