--- deliantra/Deliantra-Client/DC/Macro.pm 2006/12/09 02:21:25 1.1 +++ deliantra/Deliantra-Client/DC/Macro.pm 2006/12/09 21:44:43 1.2 @@ -158,6 +158,23 @@ $window->show; } +# 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; + } + + () +} + sub keyboard_setup { my $kbd_setup = new CFPlus::UI::VBox;