--- deliantra/Deliantra-Client/DC/MapWidget.pm 2008/08/27 20:19:52 1.141 +++ deliantra/Deliantra-Client/DC/MapWidget.pm 2008/08/30 08:04:01 1.142 @@ -287,24 +287,29 @@ } my %DIR = ( - ( "," . DC::SDLK_KP5 ), [0, "stay fire"], - ( "," . DC::SDLK_KP8 ), [1, "north"], - ( "," . DC::SDLK_KP9 ), [2, "northeast"], - ( "," . DC::SDLK_KP6 ), [3, "east"], - ( "," . DC::SDLK_KP3 ), [4, "southeast"], - ( "," . DC::SDLK_KP2 ), [5, "south"], - ( "," . DC::SDLK_KP1 ), [6, "southwest"], - ( "," . DC::SDLK_KP4 ), [7, "west"], - ( "," . DC::SDLK_KP7 ), [8, "northwest"], - - ( "," . DC::SDLK_UP ), [1, "north"], - ("1," . DC::SDLK_UP ), [2, "northeast"], - ( "," . DC::SDLK_RIGHT), [3, "east"], - ("1," . DC::SDLK_RIGHT), [4, "southeast"], - ( "," . DC::SDLK_DOWN ), [5, "south"], - ("1," . DC::SDLK_DOWN ), [6, "southwest"], - ( "," . DC::SDLK_LEFT ), [7, "west"], - ("1," . DC::SDLK_LEFT ), [8, "northwest"], + ( "," . DC::SDLK_KP5 ), [0, "stay fire"], + ( "," . DC::SDLK_KP8 ), [1, "north"], + ( "," . DC::SDLK_KP9 ), [2, "northeast"], + ( "," . DC::SDLK_KP6 ), [3, "east"], + ( "," . DC::SDLK_KP3 ), [4, "southeast"], + ( "," . DC::SDLK_KP2 ), [5, "south"], + ( "," . DC::SDLK_KP1 ), [6, "southwest"], + ( "," . DC::SDLK_KP4 ), [7, "west"], + ( "," . DC::SDLK_KP7 ), [8, "northwest"], + + ( "," . DC::SDLK_PAGEUP ), [2, "northeast"], + ( "," . DC::SDLK_PAGEDOWN ), [4, "southeast"], + ( "," . DC::SDLK_END ), [6, "southwest"], + ( "," . DC::SDLK_HOME ), [8, "northwest"], + + ( "," . DC::SDLK_UP ), [1, "north"], + ("1," . DC::SDLK_UP ), [2, "northeast"], + ( "," . DC::SDLK_RIGHT ), [3, "east"], + ("1," . DC::SDLK_RIGHT ), [4, "southeast"], + ( "," . DC::SDLK_DOWN ), [5, "south"], + ("1," . DC::SDLK_DOWN ), [6, "southwest"], + ( "," . DC::SDLK_LEFT ), [7, "west"], + ("1," . DC::SDLK_LEFT ), [8, "northwest"], ); sub invoke_key_down { @@ -314,14 +319,16 @@ my $sym = $ev->{sym}; my $uni = $ev->{unicode}; - $mod &= DC::KMOD_CTRL | DC::KMOD_ALT | DC::KMOD_SHIFT; + $mod &= DC::KMOD_CTRL | DC::KMOD_ALT | DC::KMOD_META | DC::KMOD_SHIFT; # ignore repeated keypresses return if $self->{last_mod} == $mod && $self->{last_sym} == $sym; $self->{last_mod} = $mod; $self->{last_sym} = $sym; - if ($::CONN && (my $dir = $DIR{(!!($mod & DC::KMOD_ALT)) . ",$sym"})) { + my $dir = $DIR{ (!!($mod & (DC::KMOD_ALT | DC::KMOD_META))) . ",$sym" }; + + if ($::CONN && $dir) { if ($mod & DC::KMOD_SHIFT) { $self->{shft}++; if ($dir->[0] != $self->{fire_dir}) { @@ -358,7 +365,9 @@ $res = 1; } } else { - if (exists $DIR{(!!($mod & DC::KMOD_ALT)) . ",$sym"} && delete $self->{shft}) { + my $dir = $DIR{ (!!($mod & (DC::KMOD_ALT | DC::KMOD_META))) . ",$sym" }; + + if ($dir && delete $self->{shft}) { $::CONN->user_send ("fire_stop"); delete $self->{fire_dir}; $res = 1; @@ -370,7 +379,7 @@ } } - if (!($mod & DC::KMOD_CTRL ) && delete $self->{ctrl}) { + if (!($mod & DC::KMOD_CTRL) && delete $self->{ctrl}) { $::CONN->user_send ("run_stop"); $res = 1; }