… | |
… | |
30 | @_ |
30 | @_ |
31 | ); |
31 | ); |
32 | |
32 | |
33 | $self->{completer} = new CFClient::MapWidget::Command:: |
33 | $self->{completer} = new CFClient::MapWidget::Command:: |
34 | command => $self->{command}, |
34 | command => $self->{command}, |
35 | can_focus => 1, |
|
|
36 | tooltip => "<b>The Command Completer</b>\n\n" |
35 | tooltip => "<b>The Command Completer</b>\n\n" |
37 | . "This is your central interface to send text commands to the server. " |
36 | . "This is your central interface to send text commands to the server. " |
38 | . "To enter a verbatim command to send to the server, just type the command, " |
37 | . "To enter a verbatim command to send to the server, just type the command, " |
39 | . "followed by a space, and press return. " |
38 | . "followed by a space, and press return. " |
40 | . "Typing the initial letters of words (or just any letters) displays guesses " |
39 | . "Typing the initial letters of words (or just any letters) displays guesses " |
… | |
… | |
244 | $::CONN->user_send ("run $DIR{$sym}[0]"); |
243 | $::CONN->user_send ("run $DIR{$sym}[0]"); |
245 | } else { |
244 | } else { |
246 | $::CONN->user_send ("$DIR{$sym}[1]"); |
245 | $::CONN->user_send ("$DIR{$sym}[1]"); |
247 | } |
246 | } |
248 | } elsif ((ord 'a') <= $uni && $uni <= (ord 'z')) { |
247 | } elsif ((ord 'a') <= $uni && $uni <= (ord 'z')) { |
249 | $self->{completer}->invoke_key_down ($ev); |
248 | $self->{completer}->inject_key_down ($ev); |
250 | $self->{completer}->show; |
249 | $self->{completer}->show; |
251 | } else { |
250 | } else { |
252 | return 0; |
251 | return 0; |
253 | } |
252 | } |
254 | |
253 | |
… | |
… | |
625 | |
624 | |
626 | $self->SUPER::hide; |
625 | $self->SUPER::hide; |
627 | $self->{entry}->set_text (""); |
626 | $self->{entry}->set_text (""); |
628 | } |
627 | } |
629 | |
628 | |
630 | sub invoke_key_down { |
629 | sub inject_key_down { |
631 | my ($self, $ev) = @_; |
630 | my ($self, $ev) = @_; |
632 | |
631 | |
|
|
632 | $self->{entry}->grab_focus; |
633 | $self->{entry}->emit (key_down => $ev) |
633 | $self->{entry}->emit (key_down => $ev); |
634 | } |
634 | } |
635 | |
635 | |
636 | sub update_labels { |
636 | sub update_labels { |
637 | my ($self) = @_; |
637 | my ($self) = @_; |
638 | |
638 | |