ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.358 by root, Fri Dec 8 14:59:54 2006 UTC vs.
Revision 1.360 by root, Fri Dec 8 22:25:32 2006 UTC

1967 ++$self->{cursor} if $self->{cursor} < length $self->{text}; 1967 ++$self->{cursor} if $self->{cursor} < length $self->{text};
1968 } elsif ($sym == CFPlus::SDLK_HOME) { 1968 } elsif ($sym == CFPlus::SDLK_HOME) {
1969 $self->{cursor} = 0; 1969 $self->{cursor} = 0;
1970 } elsif ($sym == CFPlus::SDLK_END) { 1970 } elsif ($sym == CFPlus::SDLK_END) {
1971 $self->{cursor} = length $text; 1971 $self->{cursor} = length $text;
1972 } elsif ($uni == 21) { # ctrl-u 1972 } elsif ($uni == 21) { # ctrl-u
1973 $text = ""; 1973 $text = "";
1974 $self->{cursor} = 0; 1974 $self->{cursor} = 0;
1975 } elsif ($uni == 27) { 1975 } elsif ($uni == 27) {
1976 $self->emit ('escape'); 1976 $self->emit ('escape');
1977 } elsif ($uni >= 0x20) { 1977 } elsif ($uni >= 0x20 || $uni == 0x0d) {
1978 substr $text, $self->{cursor}++, 0, chr $uni; 1978 substr $text, $self->{cursor}++, 0, chr $uni;
1979 } else { 1979 } else {
1980 return 0; 1980 return 0;
1981 } 1981 }
1982 1982
2073sub invoke_key_down { 2073sub invoke_key_down {
2074 my ($self, $ev) = @_; 2074 my ($self, $ev) = @_;
2075 2075
2076 my $sym = $ev->{sym}; 2076 my $sym = $ev->{sym};
2077 2077
2078 if ($sym == 13) { 2078 if ($ev->{uni} == 0x0d || $sym == 13) {
2079 unshift @{$self->{history}}, 2079 unshift @{$self->{history}},
2080 my $txt = $self->get_text; 2080 my $txt = $self->get_text;
2081 2081
2082 $self->{history_pointer} = -1; 2082 $self->{history_pointer} = -1;
2083 $self->{history_saveback} = ''; 2083 $self->{history_saveback} = '';
2124sub move_cursor_ver { 2124sub move_cursor_ver {
2125 my ($self, $dy) = @_; 2125 my ($self, $dy) = @_;
2126 2126
2127 my ($y, $x) = $self->{layout}->index_to_line_x ($self->{cursor}); 2127 my ($y, $x) = $self->{layout}->index_to_line_x ($self->{cursor});
2128 2128
2129 do { 2129 $y += $dy;
2130
2130 if (defined (my $index = $self->{layout}->line_x_to_index ($y + $dy, $x))) { 2131 if (defined (my $index = $self->{layout}->line_x_to_index ($y, $x))) {
2131 $self->{cursor} = $index; 2132 $self->{cursor} = $index;
2132 delete $self->{cur_h}; 2133 delete $self->{cur_h};
2133 $self->update; 2134 $self->update;
2134 return; 2135 return;
2135 } 2136 }
2136 } while --$x >= 0;
2137} 2137}
2138 2138
2139sub invoke_key_down { 2139sub invoke_key_down {
2140 my ($self, $ev) = @_; 2140 my ($self, $ev) = @_;
2141 2141

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines