ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Macro.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Macro.pm (file contents):
Revision 1.3 by root, Sat Dec 9 22:06:51 2006 UTC vs.
Revision 1.4 by root, Sat Dec 9 22:28:11 2006 UTC

157 $window->grab_focus; 157 $window->grab_focus;
158 $window->show; 158 $window->show;
159} 159}
160 160
161# find macro by event 161# find macro by event
162# maybe return multiple results?
163sub match_event($) { 162sub match_event($) {
164 my ($ev) = @_; 163 my ($ev) = @_;
165 164
166 for my $macro (@{ $::PROFILE->{macro} || [] }) { 165 grep {
167 my $key = $macro->{accelkey} 166 if (my $key = $_->{accelkey}) {
168 or next;
169
170 $key->[1] == $ev->{sym} 167 $key->[1] == $ev->{sym}
171 && $key->[0] == ($ev->{mod} & $MODIFIER_MASK) 168 && $key->[0] == ($ev->{mod} & $MODIFIER_MASK)
172 && return $macro; 169 } else {
173 } 170 0
174 171 }
175 () 172 } @{ $::PROFILE->{macro} || [] }
176} 173}
177 174
178sub keyboard_setup { 175sub keyboard_setup {
179 my $kbd_setup = new CFPlus::UI::VBox; 176 my $kbd_setup = new CFPlus::UI::VBox;
180 177

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines