|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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;
print "$_ " foreach @{$event->argNames});
Note that this array of names is statical for any given event type.
print "$_ " foreach @{$event->argTypes});
Note that this array of types is statical for any given event type.
Note that you should know the order of arguments, so the suggested way is to use "args" instead, although it is a bit slower.
print "[Debug] Got event ", $event->type, " with args:\n";
while (($name, $value) = each %{$event->args})
{ print "\t$name: $value\n"; }
Last modified on August 26, 2005