--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/19 06:21:07 1.135 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/19 20:46:44 1.136 @@ -1113,7 +1113,6 @@ our @ISA = CFClient::UI::Label::; -use SDL; use SDL::OpenGL; sub new { @@ -1185,19 +1184,19 @@ my $text = $self->get_text; - if ($sym == SDLK_BACKSPACE) { + if ($sym == 8) { substr $text, --$self->{cursor}, 1, "" if $self->{cursor}; - } elsif ($sym == SDLK_DELETE) { + } elsif ($sym == 127) { substr $text, $self->{cursor}, 1, ""; - } elsif ($sym == SDLK_LEFT) { + } elsif ($sym == CFClient::SDLK_LEFT) { --$self->{cursor} if $self->{cursor}; - } elsif ($sym == SDLK_RIGHT) { + } elsif ($sym == CFClient::SDLK_RIGHT) { ++$self->{cursor} if $self->{cursor} < length $self->{text}; - } elsif ($sym == SDLK_HOME) { + } elsif ($sym == CFClient::SDLK_HOME) { $self->{cursor} = 0; - } elsif ($sym == SDLK_END) { + } elsif ($sym == CFClient::SDLK_END) { $self->{cursor} = length $text; - } elsif ($sym == SDLK_ESCAPE) { + } elsif ($sym == 27) { $self->emit ('escape'); } elsif ($uni) { substr $text, $self->{cursor}++, 0, chr $uni; @@ -1282,7 +1281,6 @@ our @ISA = CFClient::UI::EntryBase::; -use SDL; use SDL::OpenGL; sub key_down { @@ -1290,7 +1288,7 @@ my $sym = $ev->key_sym; - if ($sym == SDLK_RETURN) { + if ($sym == 13) { $self->emit (activate => $self->get_text); $self->update; @@ -1306,7 +1304,6 @@ our @ISA = CFClient::UI::Label::; -use SDL; use SDL::OpenGL; my @tex = @@ -1370,7 +1367,6 @@ map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } qw(c1_checkbox_bg.png c1_checkbox_active.png); -use SDL; use SDL::OpenGL; sub new {