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.13 by elmex, Sun Sep 9 17:47:00 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",
33 "enter" => "examine",
32 "[+]" => "rotateshoottype +", 34 "[+]" => "rotateshoottype +",
33 "[-]" => "rotateshoottype -", 35 "[-]" => "rotateshoottype -",
34 "LAlt-s" => "ready_skill find traps", 36 "LAlt-s" => "ready_skill find traps",
35 "LAlt-d" => "ready_skill disarm traps", 37 "LAlt-d" => "ready_skill disarm traps",
36 "LAlt-p" => "ready_skill praying", 38 "LAlt-p" => "ready_skill praying",
86 "toggle-inventory" => sub { ::toggle_player_page ($::INVENTORY_PAGE) }, 88 "toggle-inventory" => sub { ::toggle_player_page ($::INVENTORY_PAGE) },
87 "toggle-pickup" => sub { ::toggle_player_page ($::PICKUP_PAGE) }, 89 "toggle-pickup" => sub { ::toggle_player_page ($::PICKUP_PAGE) },
88 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility }, 90 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility },
89 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility }, 91 "toggle-setup" => sub { $::SETUP_DIALOG->toggle_visibility },
90 "switch-tab" => sub { $::MESSAGE_WINDOW->user_switch_to_page (0 + shift) }, 92 "switch-tab" => sub { $::MESSAGE_WINDOW->user_switch_to_page (0 + shift) },
93 "close-current-tab" => sub { $::MESSAGE_WINDOW->close_current_tab },
91 "activate-chat" => sub { $::MESSAGE_WINDOW->activate_current }, 94 "activate-chat" => sub { $::MESSAGE_WINDOW->activate_current },
92 "repeat-command" => sub { 95 "repeat-command" => sub {
93 $::CONN->user_send ($::COMPLETER->{last_command}) 96 $::CONN->user_send ($::COMPLETER->{last_command})
94 if $::CONN && exists $::COMPLETER->{last_command}; 97 if $::CONN && exists $::COMPLETER->{last_command};
95 }, 98 },
243} 246}
244 247
245sub find_default($) { 248sub find_default($) {
246 my ($ev) = @_; 249 my ($ev) = @_;
247 250
248 if (my $cmd = $DEFAULT_KEYMAP->{U}{$ev->{unicode}}) {
249 return $cmd;
250 }
251
252 for my $m (reverse grep $_, @{ $DEFAULT_KEYMAP->{K} }) { 251 for my $m (reverse grep $_, @{ $DEFAULT_KEYMAP->{K} }) {
253 for (keys %$m) { 252 for (keys %$m) {
254 if ($_ == ($ev->{mod} & $_)) { 253 if ($_ == ($ev->{mod} & $_)) {
255 if (defined (my $cmd = $m->{$_}{$ev->{sym}})) { 254 if (defined (my $cmd = $m->{$_}{$ev->{sym}})) {
256 return $cmd; 255 return $cmd;
257 } 256 }
258 } 257 }
259 } 258 }
259 }
260
261 if (my $cmd = $DEFAULT_KEYMAP->{U}{$ev->{unicode}}) {
262 return $cmd;
260 } 263 }
261 264
262 () 265 ()
263} 266}
264 267

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines