--- deliantra/Deliantra-Client/DC/Macro.pm 2006/12/09 22:06:51 1.3 +++ deliantra/Deliantra-Client/DC/Macro.pm 2006/12/09 22:28:11 1.4 @@ -159,20 +159,17 @@ } # find macro by event -# maybe return multiple results? sub match_event($) { my ($ev) = @_; - for my $macro (@{ $::PROFILE->{macro} || [] }) { - my $key = $macro->{accelkey} - or next; - - $key->[1] == $ev->{sym} - && $key->[0] == ($ev->{mod} & $MODIFIER_MASK) - && return $macro; - } - - () + grep { + if (my $key = $_->{accelkey}) { + $key->[1] == $ev->{sym} + && $key->[0] == ($ev->{mod} & $MODIFIER_MASK) + } else { + 0 + } + } @{ $::PROFILE->{macro} || [] } } sub keyboard_setup {