1. Herbert Breunung
  2. Kephra

Commits

Herbert Breunung  committed e8fd34d

sed starts using KeyMap API for key definitions

  • Participants
  • Parent commits 739c9a2
  • Branches sp2

Comments (0)

Files changed (1)

File lib/sed.pl

View file
  • Ignore whitespace
 
 	Wx::Event::EVT_KEY_DOWN($ed , sub {
 		my ($ed, $event) = @_;
-		my $code = $event->GetUnicodeKey;
-		if ($code == 79 and $event->ControlDown){
+		my $code = Kephra::API::KeyMap::keycode_from_event($event);
+		if ($code == Kephra::API::KeyMap::keycode_from_definition('ctrl+o')){
 			open_file( Kephra::App::Dialog::get_file_open(undef,undef,undef,undef,$self) );
 		}
-		elsif ($code == 81 and $event->ControlDown){ $self->Close }
-		elsif ($code == 83 and $event->ControlDown){
+		elsif ($code == Kephra::API::KeyMap::keycode_from_definition('ctrl+q')){ $self->Close }
+		elsif ($code == Kephra::API::KeyMap::keycode_from_definition('ctrl+s')){
 			Kephra::IO::LocalFile::write( $file, $encoding, $ed->GetText() );
 			$ed->SetSavePoint;
 		}