… | |
… | |
70 | return unless $::CONN; |
70 | return unless $::CONN; |
71 | |
71 | |
72 | $self->grab_focus; |
72 | $self->grab_focus; |
73 | |
73 | |
74 | if ($ev->{button} == 1) { |
74 | if ($ev->{button} == 1) { |
75 | my $x = CFClient::floor +($ev->{x} - $self->{sx0}) / $self->{tilesize} - $self->{sx}; |
75 | my $x = 1 + CFClient::floor +($ev->{x} - $self->{sx0}) / $self->{tilesize} - $self->{sx}; |
76 | my $y = CFClient::floor +($ev->{y} - $self->{sy0}) / $self->{tilesize} - $self->{sy}; |
76 | my $y = 1 + CFClient::floor +($ev->{y} - $self->{sy0}) / $self->{tilesize} - $self->{sy}; |
77 | |
77 | |
78 | $x -= int 0.5 * $self->{sw}; |
78 | $x -= int 0.5 * $self->{sw}; |
79 | $y -= int 0.5 * $self->{sh}; |
79 | $y -= int 0.5 * $self->{sh}; |
80 | |
80 | |
81 | $::CONN->lookat ($x, $y) |
81 | $::CONN->lookat ($x, $y) |
… | |
… | |
120 | 1 |
120 | 1 |
121 | } |
121 | } |
122 | |
122 | |
123 | sub size_request { |
123 | sub size_request { |
124 | ( |
124 | ( |
125 | 1 + 32 * int $::WIDTH / 32, |
125 | 32 * CFClient::ceil $::WIDTH / 32, |
126 | 1 + 32 * int $::HEIGHT / 32, |
126 | 32 * CFClient::ceil $::HEIGHT / 32, |
127 | ) |
127 | ) |
128 | } |
128 | } |
129 | |
129 | |
130 | sub update { |
130 | sub update { |
131 | my ($self) = @_; |
131 | my ($self) = @_; |
… | |
… | |
195 | } |
195 | } |
196 | } elsif ($sym == CFClient::SDLK_INSERT && $mod & CFClient::KMOD_CTRL) { |
196 | } elsif ($sym == CFClient::SDLK_INSERT && $mod & CFClient::KMOD_CTRL) { |
197 | $::BIND_EDITOR->set_binding (undef, undef, [], |
197 | $::BIND_EDITOR->set_binding (undef, undef, [], |
198 | sub { |
198 | sub { |
199 | my ($mod, $sym, $cmds) = @_; |
199 | my ($mod, $sym, $cmds) = @_; |
200 | $::CFG->{profile}{default}{bindings}{$mod}{$sym} = $cmds; |
200 | $::BIND_EDITOR->cfg_bind ($mod, $sym, $cmds); |
201 | }); |
201 | }); |
202 | $::BIND_EDITOR->start; |
202 | $::BIND_EDITOR->start; |
203 | $::BIND_EDITOR->show; |
203 | $::BIND_EDITOR->show; |
204 | } elsif ($sym == CFClient::SDLK_INSERT && not ($mod & CFClient::KMOD_CTRL)) { |
204 | } elsif ($sym == CFClient::SDLK_INSERT && not ($mod & CFClient::KMOD_CTRL)) { |
205 | $::BIND_EDITOR->stop; |
205 | $::BIND_EDITOR->stop; |
… | |
… | |
505 | if ($ev->{sym} == 13) { |
505 | if ($ev->{sym} == 13) { |
506 | if (exists $self->{select}) { |
506 | if (exists $self->{select}) { |
507 | $self->{last_command} = $self->{select}; |
507 | $self->{last_command} = $self->{select}; |
508 | $::CONN->user_send ($self->{select}); |
508 | $::CONN->user_send ($self->{select}); |
509 | |
509 | |
510 | unshift @{$self->{history}}, $self->{select}; |
510 | unshift @{$self->{history}}, $self->{entry}->get_text; |
511 | $self->{hist_ptr} = 0; |
511 | $self->{hist_ptr} = 0; |
512 | |
512 | |
513 | $self->hide; |
513 | $self->hide; |
514 | } |
514 | } |
515 | } elsif ($ev->{sym} == 27) { |
515 | } elsif ($ev->{sym} == 27) { |