--- deliantra/Deliantra-Client/DC/Macro.pm 2008/05/05 16:19:47 1.18 +++ deliantra/Deliantra-Client/DC/Macro.pm 2010/04/03 02:58:24 1.22 @@ -1,6 +1,6 @@ package DC::Macro; -use strict; +use common::sense; use List::Util (); use DC::UI; @@ -22,9 +22,10 @@ "f4" => "!toggle-spells", "f5" => "!toggle-inventory", "f9" => "!toggle-setup", - (map +("LAlt-$_" => "!switch-tab $_"), 0..9), - (map +("RAlt-$_" => "!switch-tab $_"), 0..9), - "LAlt-x" => "!close-current-tab", + + (map +("LRAM-$_" => "!switch-tab $_"), 0..9), + "LRAM-x" => "!close-current-tab", + "return" => "!activate-chat", "." => "!repeat-command", @@ -33,10 +34,11 @@ "enter" => "examine", "[+]" => "rotateshoottype +", "[-]" => "rotateshoottype -", - "LAlt-e" => "examine", - "LAlt-s" => "ready_skill find traps", - "LAlt-d" => "ready_skill disarm traps", - "LAlt-p" => "ready_skill praying", + + "LRAM-e" => "examine", + "LRAM-s" => "ready_skill find traps", + "LRAM-d" => "ready_skill disarm traps", + "LRAM-p" => "ready_skill praying", ); # allowed modifiers @@ -109,6 +111,8 @@ sub init { $DEFAULT_KEYMAP ||= do { + local $MODIFIER{LRAM} = DC::KMOD_LRAM; # hack to enable internal LRAM modifer + my %sym = map +(DC::SDL_GetKeyName $_, $_), DC::SDLK_FIRST .. DC::SDLK_LAST; my $map; @@ -454,12 +458,12 @@ if ($ev->{button} == 1) { $edit_macro->($macro), } elsif ($ev->{button} == 2) { - $::CONN->macro_send ($macro) if $::CONN; + execute ($macro); } elsif ($ev->{button} == 3) { (new DC::UI::Menu items => [ ["Edit" => sub { $edit_macro->($macro) }], - ["Invoke" => sub { $::CONN->macro_send ($macro) if $::CONN }], + ["Invoke" => sub { execute ($macro) }], ["Delete" => sub { # might want to use grep instead splice @{$::PROFILE->{macro}}, $idx, 1, ();