… | |
… | |
17 | } |
17 | } |
18 | |
18 | |
19 | sub on_button_press { |
19 | sub on_button_press { |
20 | my ($self, $event) = @_; |
20 | my ($self, $event) = @_; |
21 | |
21 | |
22 | return |
|
|
23 | if $self->current_screen || $self->hidden_cursor || !$self->{enabled}; |
22 | $self->current_screen || $self->hidden_cursor || !$self->{enabled} |
|
|
23 | and return; |
|
|
24 | |
|
|
25 | my $mask = $self->ModLevel3Mask | $self->ModMetaMask |
|
|
26 | | urxvt::ShiftMask | urxvt::ControlMask; |
|
|
27 | |
|
|
28 | ($event->{state} & $mask) == urxvt::ShiftMask |
|
|
29 | or return; |
24 | |
30 | |
25 | $termios->getattr ($self->pty_fd) |
31 | $termios->getattr ($self->pty_fd) |
26 | or return; |
32 | or return; |
27 | |
33 | |
28 | return |
|
|
29 | if $termios->getlflag & &POSIX::ICANON; |
34 | $termios->getlflag & &POSIX::ICANON |
|
|
35 | and return; |
30 | |
36 | |
31 | my ($row, $col) = $self->screen_cur; |
37 | my ($row, $col) = $self->screen_cur; |
32 | my $line = $self->line ($row); |
38 | my $line = $self->line ($row); |
33 | my $cur = $line->offset_of ($row, $col); |
39 | my $cur = $line->offset_of ($row, $col); |
34 | my $ofs = $line->offset_of ($event->{row}, $event->{col}); |
40 | my $ofs = $line->offset_of ($event->{row}, $event->{col}); |