# This needs to go into /src/pce/app/events.pm # Re-Implement key_down_filter via a hash lookup sub key_down_filter { my ($sci_frame, $event) = @_; my $key = $event->GetKeyCode; if ($key == 13){ my $newline; if ($pce::config{'editpanel'}{'blockindent'}){ my $pos = $sci_frame->GetCurrentPos-1; #$pos-- while ($sci_frame->GetCharAt($pos) == 32); my $char = $sci_frame->GetCharAt($pos); if ($char == 123) {pce::edit::format::blockindent_open($pos); $newline++} elsif ($char == 125) {pce::edit::format::blockindent_close($pos); $newline++} } unless ($newline) { if ($pce::config{'editpanel'}{'autoindent'}) {pce::edit::format::autoindent();} else {$sci_frame->CmdKeyExecute(wxSTC_CMD_NEWLINE)} } return; } elsif ($key == 351){ # F10 use Data::Dumper; #pce::dialog::msg_box(undef,Dumper $pce::internal{'file'}{'current'},""); # Get "current" filename my $current_dir = $pce::internal{'file'} ->{'current'} ->{'open'} ->[pce::document::get_current_nr()] ->{'directory'}; $current_dir =~ tr!/!\\!; # Win32 fix # Spawn a console there use Cwd; my $old_dir = getcwd; chdir $current_dir; system(qq{start cmd.exe /k g:\\systeme\\tools\\path.cmd}); chdir $old_dir; #elsif ($key == 350){ # use pce::ext::Perl::Syntax; # pce::ext::Perl::Syntax::check(); # return; #}; #pce::app::visual::status_msg(); #SCI_SETSELECTIONMODE #elsif ($event->AltDown){ #if ($key == 49){pce::document::change_current(0);} #if ($key == 50){pce::document::change_current(1);} #if ($key == 51){pce::document::change_current(2);} #if ($key == 52){pce::document::change_current(3);} #if ($key == 53){pce::document::change_current(4);} #if ($key == 54){pce::document::change_current(5);} #if ($key == 55){pce::document::change_current(6);} #if ($key == 56){pce::document::change_current(7);} #if ($key == 57){pce::document::change_current(8);} #if ($key == 48){pce::document::change_current(9);} #pce::dialog::msg_box(undef,$key,""); # $event->Skip; } else { #pce::dialog::msg_box(undef,$key,""); $event->Skip; } }