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.10 by root, Sun Sep 2 03:55:03 2007 UTC vs.
Revision 1.12 by root, Sun Sep 2 09:48:41 2007 UTC

27 "return" => "!activate-chat", 27 "return" => "!activate-chat",
28 "." => "!repeat-command", 28 "." => "!repeat-command",
29 29
30 "," => "take", 30 "," => "take",
31 "space" => "apply", 31 "space" => "apply",
32 "enter" => "examine",
32 "[+]" => "rotateshoottype +", 33 "[+]" => "rotateshoottype +",
33 "[-]" => "rotateshoottype -", 34 "[-]" => "rotateshoottype -",
34 "LAlt-s" => "ready_skill find traps", 35 "LAlt-s" => "ready_skill find traps",
35 "LAlt-d" => "ready_skill disarm traps", 36 "LAlt-d" => "ready_skill disarm traps",
36 "LAlt-p" => "ready_skill praying", 37 "LAlt-p" => "ready_skill praying",
243} 244}
244 245
245sub find_default($) { 246sub find_default($) {
246 my ($ev) = @_; 247 my ($ev) = @_;
247 248
248 if (my $cmd = $DEFAULT_KEYMAP->{U}{$ev->{unicode}}) {
249 return $cmd;
250 }
251
252 for my $m (reverse grep $_, @{ $DEFAULT_KEYMAP->{K} }) { 249 for my $m (reverse grep $_, @{ $DEFAULT_KEYMAP->{K} }) {
253 for (keys %$m) { 250 for (keys %$m) {
254 if ($_ == ($ev->{mod} & $_)) { 251 if ($_ == ($ev->{mod} & $_)) {
255 if (defined (my $cmd = $m->{$_}{$ev->{sym}})) { 252 if (defined (my $cmd = $m->{$_}{$ev->{sym}})) {
256 return $cmd; 253 return $cmd;
257 } 254 }
258 } 255 }
259 } 256 }
257 }
258
259 if (my $cmd = $DEFAULT_KEYMAP->{U}{$ev->{unicode}}) {
260 return $cmd;
260 } 261 }
261 262
262 () 263 ()
263} 264}
264 265

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines