Home
Authors History
Donations Cats
News
News FVWM Logo
Logo Competition
Features
Features
Download
Download
Icons and Sounds
Screenshots
Desktop Screenshots Menu Screenshots
Window Decor Screenshots Vectorbuttons
Documentation
Documentation Man pages
FAQ Developer Info
Mailing Lists
Mailing Lists
Links
Links
Customize
 
 Official FVWM Home Page plain theme

FVWM - Perl library - FVWM::Event


FVWM::Event

Section: FVWM Perl library (3)
Updated: 2005-08-24
Source: FVWM/Event.pm
This page contents - Return to main index
 

NAME

FVWM::Event - the FVWM event object passed to event handlers  

SYNOPSIS

  use lib `fvwm-perllib dir`;
  use FVWM::Module;

  my $module = new FVWM::Module(Mask => M_FOCUS_CHANGE);

  # auto-raise all windows
  sub autoRaise ($$) {
      my ($module, $event) = @_;
      $module->debug("Got " . $event->name . "\n");
      $module->debug("\t$_: " . $event->args->{$_} . "\n")
          foreach sort keys %{$event->args};
      $module->send("Raise", $event->_win_id);
  }
  $module->addHandler(M_FOCUS_CHANGE, \&autoRaise);

  $module->eventLoop;
 

DESCRIPTION

To be written.  

METHODS

new type argValues
Constructs event object of the given type. argValues is either an array ref of event's arguments (every event type has its own argument list, see FVWM::EventNames) or a packed string of these arguments as received from the fvwm pipe.
type
Returns event's type (usually long integer).
argNames
Returns an array ref of the event argument names.

    print "$_ " foreach @{$event->argNames});

Note that this array of names is statical for any given event type.

argTypes
Returns an array ref of the event argument types.

    print "$_ " foreach @{$event->argTypes});

Note that this array of types is statical for any given event type.

loopArgNames
Returns an array ref of the looped argument names of the event (or undef).
loopArgTypes
Returns an array ref of the looped argument types of the event (or undef).
argValues
Returns an array ref of the event argument values. In the previous versions of the library, all argument values were passed to event handlers, now only one event object is passed. Calling this method is the way to emulate the old behaviour.

Note that you should know the order of arguments, so the suggested way is to use "args" instead, although it is a bit slower.

args
Returns hash ref of the named event argument values.

    print "[Debug] Got event ", $event->type, " with args:\n";
    while (($name, $value) = each %{$event->args})
        { print "\t$name: $value\n"; }
isExtended
For technical reasons there are 2 categories of FVWM events, regular and extended. This was done to enable more events. With introdution of the extended event types (with the highest bit set) it is now possible to have 31+31=62 different event types rather than 32. This is a good point, the bad point is that only event types of the same category may be masked (or-ed) together. This method returns 1 or 0 depending on whether the event is extended or not.
name
Returns a string representing the event name (like ``M_ADD_WINDOW''), it is the same as the corresponding C/Perl constant. May be (and in fact is) used for debugging.
propagationAllowed [bool]
Sets or returns a boolean value that indicates enabling or disabling of this event propagation.
dump
Returns a string representation of the event object, basically the event name and all argument name=value lines.
_name
This is a shortcut for $event->args->{'name'}. Returns the named event argument. See FVWM::EventNames for names of all event argument names.
 

AUTHOR

Mikhael Goikhman <migo@homemail.com>.  

SEE ALSO

For more information, see fvwm, FVWM::Module, FVWM::Constants and FVWM::EventNames.


 

Index

NAME
SYNOPSIS
DESCRIPTION
METHODS
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 00:51:25 GMT, August 27, 2005

Last modified on April 26, 2010