# Right mouse click on VTE $$self{_GUI}{_VTE}->signal_connect( 'button_press_event' => sub { if ($right_click_deep) { return 0; # Bubble up, let VTE's original handler take care of it. } my ($widget, $event) = @_; my $state = $event->get_state(); my $shift = $state * ['shift-mask']; if ($event->button eq 2) { if (!$$self{_CFG}{'environments'}{ $$self{_UUID} }{'send slow'}) { return 0; } $$self{_GUI}{_VTE}->paste_primary(); $$self{FOCUS}->child_focus('GTK_DIR_TAB_FORWARD'); return 1; } elsif ($event->button eq 3 and $event->type eq 'button-press') { # See #209 for all this hack. my $handled_by_vte = 0; if (!$shift) { $right_click_deep = 1; $handled_by_vte = $$self{_GUI}{_VTE}->event($event); $right_click_deep = 0; } if (!$handled_by_vte) { $$self{FOCUS}->child_focus('GTK_DIR_TAB_FORWARD'); $self->_vteMenu($event); } return 1; # One way or another, we've handled it. } elsif ($event->button eq 1 && $event->type eq 'button-press' && $shift) { my ($w, $h) = $$self{_WINDOWTERMINAL}->get_size(); my ($col, $row) = (int($event->x / $$self{_GUI}{_VTE}->get_char_width()), int($event->y / $$self{_GUI}{_VTE}->get_char_width() - 1)); print "($col,$row)\n"; my $func = sub { return 1 }; #my $string = $$self{_GUI}{_VTE}->get_text_range($row, $col, $row, int($w / $$self{_GUI}{_VTE}->get_char_width() + 0.5), $func, my $data = undef); my $string = $$self{_GUI}{_VTE}->get_text_range(1, 0, 1, 5, $func, my $data = undef); #my @list = $$self{_GUI}{_VTE}->get_text(); #print "($row,$col):@list\n"; } #### my @list = $$self{_GUI}{_VTE}->get_text(); my @list = $$self{_GUI}{_VTE}->get_text($func = udef,$data = undef);