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.11 by root, Sun Sep 2 08:31:53 2007 UTC vs.
Revision 1.14 by root, Sun Oct 14 20:08:26 2007 UTC

22 "f4" => "!toggle-spells", 22 "f4" => "!toggle-spells",
23 "f5" => "!toggle-inventory", 23 "f5" => "!toggle-inventory",
24 "f9" => "!toggle-setup", 24 "f9" => "!toggle-setup",
25 (map +("LAlt-$_" => "!switch-tab $_"), 0..9), 25 (map +("LAlt-$_" => "!switch-tab $_"), 0..9),
26 (map +("RAlt-$_" => "!switch-tab $_"), 0..9), 26 (map +("RAlt-$_" => "!switch-tab $_"), 0..9),
27 "LAlt-x" => "!close-current-tab",
27 "return" => "!activate-chat", 28 "return" => "!activate-chat",
28 "." => "!repeat-command", 29 "." => "!repeat-command",
29 30
30 "," => "take", 31 "," => "take",
31 "space" => "apply", 32 "space" => "apply",
32 "enter" => "examine", 33 "enter" => "examine",
33 "[+]" => "rotateshoottype +", 34 "[+]" => "rotateshoottype +",
34 "[-]" => "rotateshoottype -", 35 "[-]" => "rotateshoottype -",
36 "LAlt-e" => "examine",
35 "LAlt-s" => "ready_skill find traps", 37 "LAlt-s" => "ready_skill find traps",
36 "LAlt-d" => "ready_skill disarm traps", 38 "LAlt-d" => "ready_skill disarm traps",
37 "LAlt-p" => "ready_skill praying", 39 "LAlt-p" => "ready_skill praying",
38); 40);
39 41
87 "toggle-inventory" => sub { ::toggle_player_page ($::INVENTORY_PAGE) }, 89 "toggle-inventory" => sub { ::toggle_player_page ($::INVENTORY_PAGE) },
88 "toggle-pickup" => sub { ::toggle_player_page ($::PICKUP_PAGE) }, 90 "toggle-pickup" => sub { ::toggle_player_page ($::PICKUP_PAGE) },
89 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility }, 91 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility },
90 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility }, 92 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility },
91 "switch-tab" => sub { $::MESSAGE_WINDOW->user_switch_to_page (0 + shift) }, 93 "switch-tab" => sub { $::MESSAGE_WINDOW->user_switch_to_page (0 + shift) },
94 "close-current-tab" => sub { $::MESSAGE_WINDOW->close_current_tab },
92 "activate-chat" => sub { $::MESSAGE_WINDOW->activate_current }, 95 "activate-chat" => sub { $::MESSAGE_WINDOW->activate_current },
93 "repeat-command" => sub { 96 "repeat-command" => sub {
94 $::CONN->user_send ($::COMPLETER->{last_command}) 97 $::CONN->user_send ($::COMPLETER->{last_command})
95 if $::CONN && exists $::COMPLETER->{last_command}; 98 if $::CONN && exists $::COMPLETER->{last_command};
96 }, 99 },
244} 247}
245 248
246sub find_default($) { 249sub find_default($) {
247 my ($ev) = @_; 250 my ($ev) = @_;
248 251
249 if (my $cmd = $DEFAULT_KEYMAP->{U}{$ev->{unicode}}) {
250 return $cmd;
251 }
252
253 for my $m (reverse grep $_, @{ $DEFAULT_KEYMAP->{K} }) { 252 for my $m (reverse grep $_, @{ $DEFAULT_KEYMAP->{K} }) {
254 for (keys %$m) { 253 for (keys %$m) {
255 if ($_ == ($ev->{mod} & $_)) { 254 if ($_ == ($ev->{mod} & $_)) {
256 if (defined (my $cmd = $m->{$_}{$ev->{sym}})) { 255 if (defined (my $cmd = $m->{$_}{$ev->{sym}})) {
257 return $cmd; 256 return $cmd;
258 } 257 }
259 } 258 }
260 } 259 }
260 }
261
262 if (my $cmd = $DEFAULT_KEYMAP->{U}{$ev->{unicode}}) {
263 return $cmd;
261 } 264 }
262 265
263 () 266 ()
264} 267}
265 268

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines